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.
Add a test for the preprocessor and errors
Add `asr_preprocess` test type for this purpose.
- Loading branch information
Showing
11 changed files
with
89 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,8 @@ | ||
program cpp1 | ||
implicit none | ||
#define X123 z12345678 | ||
integer :: x, y | ||
x = (2+3)*5 | ||
! Error: `z12345678` not defined: | ||
print *, x, X123, y | ||
end program |
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,8 @@ | ||
program cpp2 | ||
implicit none | ||
#define X123 12345678 | ||
integer :: x | ||
x = (2+3)*5 | ||
! Error: `yy` not defined: | ||
print *, x, X123, yy | ||
end program |
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,8 @@ | ||
program cpp3 | ||
implicit none | ||
#define X123 12345678 | ||
integer :: x, y | ||
x = (2+3)*5 | ||
! Error: `xx` not defined: | ||
print *, xx, X123, y | ||
end program |
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_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": "6a9dc73e6103cd15f6617fc34102816fea0bc4313283add1d1bb3d18", | ||
"returncode": 2 | ||
} |
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,3 @@ | ||
input:7:13 semantic error: Variable 'z12345678' not declared | ||
print *, x, X123, y | ||
^~~~ |
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_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": "8c46515294b597d1ce46003645208f2f595f57b73e4116023d12d733", | ||
"returncode": 2 | ||
} |
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,3 @@ | ||
input:7:19 semantic error: Variable 'yy' not declared | ||
print *, x, X123, yy | ||
^~ |
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_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": "b8867c48aa80b6656e2febc5f6c6dec4c055c5b5f1c0aad60fcd7a05", | ||
"returncode": 2 | ||
} |
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,3 @@ | ||
input:7:10 semantic error: Variable 'xx' not declared | ||
print *, xx, X123, y | ||
^~ |
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