Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two futures for issues I encountered with arrays of ranges #26619

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/library/standard/Sort/correctness/arrayOfRanges.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: In function 'compareByPart':
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: error: illegal tuple variable declaration with non-tuple initializer
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: called as compareByPart(a: range(int(64),both,one), b: range(int(64),both,one), comparator: defaultComparator)
within internal functions (use --print-callstack-on-error to see)
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: called as shellSortMoveElts(Data: [domain(1,int(64),one)] range(int(64),both,one), comparator: defaultComparator, start: int(64), end: int(64)) from function 'msbRadixSort'
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: called as msbRadixSort(A: [domain(1,int(64),one)] range(int(64),both,one), start_n: int(64), end_n: int(64), criterion: defaultComparator, startbit: int(64), endbit: int(64), settings: MSBRadixSortSettings(5,false,false)) from function 'msbRadixSort'
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: called as msbRadixSort(Data: [domain(1,int(64),one)] range(int(64),both,one), comparator: defaultComparator, region: range(int(64),both,one)) from function 'unstableSort'
$CHPL_HOME/modules/standard/Sort.chpl:nnnn: called as unstableSort(x: [domain(1,int(64),one)] range(int(64),both,one), comparator: defaultComparator, region: range(int(64),both,one)) from function 'sort'
arrayOfRanges.chpl:8: called as sort(x: [domain(1,int(64),one)] range(int(64),both,one), comparator: defaultComparator, param stable = false)
10 changes: 10 additions & 0 deletions test/library/standard/Sort/correctness/arrayOfRanges.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Motivated by wanting to sort the ranges returned by the range leader iterator
use Sort;

var arr: [0..4] range = [1..2, 3..4, 6..7, 5..5, -1..0];

writeln(arr);

sort(arr);

writeln(arr);
2 changes: 2 additions & 0 deletions test/library/standard/Sort/correctness/arrayOfRanges.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
unimplemented feature: sorting arrays of ranges
#26616
1 change: 1 addition & 0 deletions test/library/standard/Sort/correctness/arrayOfRanges.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-1..0 1..2 3..4 5..5 6..7
3 changes: 3 additions & 0 deletions test/library/standard/Sort/correctness/arrayOfRanges.prediff
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

$CHPL_HOME/util/test/prediff-obscure-module-linenos $@
1 change: 1 addition & 0 deletions test/types/range/arrayOfRanges.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arrayOfRanges.chpl:10: error: Heterogeneous tuples don't support this style of loop yet
19 changes: 19 additions & 0 deletions test/types/range/arrayOfRanges.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Motivated by getting the subranges from the range leader iterator
var arr: [0..4] range = [1..2, 3..4, 6..7, 5..5, -1..0];

writeln(arr);

var arr2: [arr.domain] int;

// I wanted to store the size of each of the ranges into a separate array, but
// writing it like this didn't work.
forall (i, r) in (arr.domain, arr) {
arr2[i] = r.size;
}
/* Had to use this instead:
for i in arr.domain {
arr2[i] = arr[i].size;
}
*/

writeln(arr2);
2 changes: 2 additions & 0 deletions test/types/range/arrayOfRanges.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
unimplemented feature: zippering an array of ranges with something else
#26618
2 changes: 2 additions & 0 deletions test/types/range/arrayOfRanges.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1..2 3..4 6..7 5..5 -1..0
2 2 2 1 2