-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to check for unnecessary allocation
--- Signed-off-by: Michael Ferguson <[email protected]>
- Loading branch information
Showing
6 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
test/arrays/ferguson/array-initialization-patterns/post-alloc-dists.prediff
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
# show only lines containing "alloc int" | ||
# show only lines after "alloc test begins" | ||
# show only lines before "alloc test begins" | ||
# show only lines after "alloc int test begins" | ||
# show only lines before "alloc int test ends" | ||
cat $2 | grep "alloc int" | grep -A 1000 "alloc int test begins" | grep -B 1000 "alloc int test ends" > $2.tmp | ||
mv $2.tmp $2 |
4 changes: 2 additions & 2 deletions
4
test/arrays/ferguson/array-initialization-patterns/post-alloc.prediff
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
# show only lines containing 'alloc int' | ||
# show only lines after "alloc test begins" | ||
# show only lines before "alloc test begins" | ||
# show only lines after "alloc int test begins" | ||
# show only lines before "alloc int test ends" | ||
cat $2 | grep "alloc int" | grep -A 1000 "alloc int test begins" | grep -B 1000 "alloc int test ends" > $2.tmp | ||
mv $2.tmp $2 |
16 changes: 16 additions & 0 deletions
16
test/arrays/ferguson/array-initialization-patterns/return-array-declared-type.chpl
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 @@ | ||
// this test is intended as a reproducer for the | ||
// problem of too much memory allocated | ||
// shown in issue #25741 | ||
|
||
config const n = 100_000; | ||
|
||
proc myfn(nn: int) : [0..<nn] int { | ||
var ret: [0..<nn] int; | ||
return ret; | ||
} | ||
|
||
proc main() { | ||
writeln("alloc int test begins"); | ||
var x = myfn(n); | ||
writeln("alloc int test ends"); | ||
} |
1 change: 1 addition & 0 deletions
1
test/arrays/ferguson/array-initialization-patterns/return-array-declared-type.compopts
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 @@ | ||
--set debugDefaultDist=true |
4 changes: 4 additions & 0 deletions
4
test/arrays/ferguson/array-initialization-patterns/return-array-declared-type.good
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,4 @@ | ||
alloc int test begins | ||
*** DR alloc int(64) 100000 | ||
*** DR calling postalloc int(64) 100000 | ||
alloc int test ends |
6 changes: 6 additions & 0 deletions
6
test/arrays/ferguson/array-initialization-patterns/return-array-declared-type.prediff
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,6 @@ | ||
#!/bin/bash | ||
# show only lines containing 'alloc int' | ||
# show only lines after "alloc int test begins" | ||
# show only lines before "alloc int test ends" | ||
cat $2 | grep "alloc int" | grep -A 1000 "alloc int test begins" | grep -B 1000 "alloc int test ends" > $2.tmp | ||
mv $2.tmp $2 |