forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
program nullify_01 | ||
implicit none | ||
|
||
integer, pointer :: p1, p2 | ||
integer, target :: t1 | ||
|
||
p1=>t1 | ||
p2=>t1 | ||
p1 = 1 | ||
nullify(p1, p2) | ||
|
||
end program nullify_01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
program 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"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": "4cf7b13ba6cf51c300539d58843aa752f0eb5185e9712690b11bc9d8", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(TranslationUnit (SymbolTable 1 {nullify_01: (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_01 [] [(=> (Var 2 p1) (Var 2 t1)) (=> (Var 2 p2) (Var 2 t1)) (= (Var 2 p1) (ConstantInteger 1 (Integer 4 [])) ()) (Nullify [2 p1 2 p2])])}) []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"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": "6d3127f42329e3029bd4d604dce4b3a9ad7515db5fff04b9673a05c5", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(TranslationUnit (SymbolTable 1 {nullify_02: (Program (SymbolTable 2 {p1: (Variable 2 p1 Local () () Default (Pointer (Real 4 [])) Source Public Required .false.), p2: (Variable 2 p2 Local () () Default (Pointer (Integer 4 [])) Source Public Required .false.), t1: (Variable 2 t1 Local () () Default (Real 4 []) Source Public Required .false.), t2: (Variable 2 t2 Local () () Default (Integer 4 []) Source Public Required .false.)}) nullify_02 [] [(=> (Var 2 p1) (Var 2 t1)) (= (Var 2 p1) (ImplicitCast (ConstantInteger 1 (Integer 4 [])) IntegerToReal (Pointer (Real 4 [])) (ConstantReal 1.000000 (Real 4 []))) ()) (=> (Var 2 p2) (Var 2 t2)) (= (Var 2 p2) (ImplicitCast (ConstantReal 2.000000 (Real 4 [])) RealToInteger (Pointer (Integer 4 [])) (ConstantInteger 2 (Integer 4 []))) ()) (Nullify [2 p1 2 p2])])}) []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"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": "fef0d9bd9b7a0c9e990f66d6973b62f8c9e736885a21e5f3f1a28999", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(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)]))] [(=> 0 p1 t1 ()) (=> 0 p2 t1 ()) (= 0 p1 1 ()) (Nullify 0 [p1 p2] [] (TriviaNode [] [(EndOfLine) (EndOfLine)]))] [])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"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": "15fe1c8febd35a74a234d8e519186802feb86ae388cf89cc6a10e982", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(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)]))] [(=> 0 p1 t1 ()) (= 0 p1 1 ()) (=> 0 p2 t2 ()) (= 0 p2 (Real "2.") ()) (Nullify 0 [p1 p2] [] (TriviaNode [] [(EndOfLine) (EndOfLine) (EndOfLine)]))] [])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"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": "7ff2dae193a77a7dcc5945817fd0be794570e0641e5fa252c92d9653", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; ModuleID = 'LFortran' | ||
source_filename = "LFortran" | ||
|
||
define i32 @main() { | ||
.entry: | ||
%p1 = alloca i32*, align 8 | ||
%p2 = alloca i32*, align 8 | ||
%t1 = alloca i32, align 4 | ||
store i32* %t1, i32** %p1, align 8 | ||
store i32* %t1, i32** %p2, align 8 | ||
%0 = load i32*, i32** %p1, align 8 | ||
store i32 1, i32* %0, align 4 | ||
store i32* null, i32** %p1, align 8 | ||
store i32* null, i32** %p2, align 8 | ||
ret i32 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"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": "258af1fc233e90af6360f3cb9cf6c388b862ef603ba273748f60bf44", | ||
"stderr": null, | ||
"stderr_hash": null, | ||
"returncode": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; ModuleID = 'LFortran' | ||
source_filename = "LFortran" | ||
|
||
define i32 @main() { | ||
.entry: | ||
%p1 = alloca float*, align 8 | ||
%p2 = alloca i32*, align 8 | ||
%t1 = alloca float, align 4 | ||
%t2 = alloca i32, align 4 | ||
store float* %t1, float** %p1, align 8 | ||
%0 = load float*, float** %p1, align 8 | ||
store float 1.000000e+00, float* %0, align 4 | ||
store i32* %t2, i32** %p2, align 8 | ||
%1 = load i32*, i32** %p2, align 8 | ||
store i32 2, i32* %1, align 4 | ||
store float* null, float** %p1, align 8 | ||
store i32* null, i32** %p2, align 8 | ||
ret i32 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters