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.
TEST: Add for diff dim, type mismatch cases using empty
- Loading branch information
1 parent
f011dbe
commit 604dce1
Showing
13 changed files
with
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from lpython import i16 | ||
from numpy import empty, int16 | ||
|
||
# checks dim mismatch for local array variable | ||
def main0(): | ||
x: i16[4] = empty([5], dtype=int16) | ||
|
||
main0() |
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 @@ | ||
from lpython import i16 | ||
from numpy import empty, int32 | ||
|
||
# checks type mismatch for local array variable | ||
def main0(): | ||
x: i16[5] = empty([5], dtype=int32) | ||
|
||
main0() |
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 @@ | ||
from lpython import i16 | ||
from numpy import empty, int16 | ||
|
||
# checks multi-dim mismatch for local array variable | ||
def main0(): | ||
x: i16[5, 4] = empty([5, 3], dtype=int16) | ||
|
||
main0() |
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 @@ | ||
from lpython import i16 | ||
from numpy import empty, int32 | ||
|
||
# checks type mismatch for multi-dim local array variable | ||
def main0(): | ||
x: i16[5, 4] = empty([5, 4], dtype=int32) | ||
|
||
main0() |
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 @@ | ||
from lpython import f32 | ||
from numpy import empty, complex64 | ||
|
||
# checks type mismatch for types apart from integers | ||
def main0(): | ||
x: f32[5, 4] = empty([5, 4], dtype=complex64) | ||
|
||
main0() |
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,11 @@ | ||
from lpython import i32, i64, Const | ||
from numpy import empty, int64 | ||
|
||
# checks multi-dim mismatch when constant variables are used as dimensions | ||
def main0(): | ||
p: Const[i32] = 100 | ||
q: Const[i32] = 120 | ||
r: Const[i32] = 200 | ||
x: i64[p, q, r] = empty([q, p, r], dtype=int64) | ||
|
||
main0() |
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,11 @@ | ||
from lpython import i32, i64 | ||
from numpy import empty, int64 | ||
|
||
# checks using runtime variables as value for multi-dims | ||
def main0(): | ||
p: i32 = 100 | ||
q: i32 = 120 | ||
r: i32 = 200 | ||
x: i64[p, q, r] = empty([q, p, r], dtype=int64) | ||
|
||
main0() |
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,11 @@ | ||
from lpython import i32, i64 | ||
from numpy import empty, int64 | ||
|
||
# checks using runtime variables as value for multi-dims of emtpy() | ||
def main0(): | ||
p: i32 = 100 | ||
q: i32 = 120 | ||
r: i32 = 200 | ||
x: i64[100, 120, 200] = empty([q, p, r], dtype=int64) | ||
|
||
main0() |
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,5 @@ | ||
from lpython import i16 | ||
from numpy import empty, int16 | ||
|
||
# Checks dim mismatch for global array variables | ||
x: i16[4] = empty([5], dtype=int16) |
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,5 @@ | ||
from lpython import i16 | ||
from numpy import empty, int32 | ||
|
||
# Checks type mismatch for global array variables | ||
x: i16[5] = empty([5], dtype=int32) |
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,9 @@ | ||
from lpython import i16 | ||
from numpy import empty, int16 | ||
|
||
# checks dim mismatch for local array variable | ||
# when dim is specified as a constant integer | ||
def main0(): | ||
x: i16[4] = empty(5, dtype=int16) | ||
|
||
main0() |
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,9 @@ | ||
from lpython import i16 | ||
from numpy import empty, int16 | ||
|
||
# checks dim mismatch for local array variable | ||
# when dim is specified as a tuple | ||
def main0(): | ||
x: i16[4] = empty((5), dtype=int16) | ||
|
||
main0() |
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