Skip to content
Snippets Groups Projects
Commit f2865cbf authored by Russel Arbore's avatar Russel Arbore
Browse files

interesting test

parent ba614011
No related branches found
No related tags found
3 merge requests!157Fork fission bufferize,!144Forkify fixes,!142More fork tests, bug fixes in fork passes and GPU backend
Pipeline #201336 failed
......@@ -5,6 +5,7 @@ dce(*);
let out = auto-outline(*);
cpu(out.test1);
cpu(out.test2);
cpu(out.test3);
ip-sroa(*);
sroa(*);
......
......@@ -21,3 +21,26 @@ fn test2(input : i32) -> i32[4, 4] {
}
return arr;
}
#[entry]
fn test3(input : i32) -> i32[3, 3] {
let arr1 : i32[3, 3];
for i = 0 to 3 {
for j = 0 to 3 {
arr1[i, j] = (i + j) as i32 + input;
}
}
let arr2 : i32[3, 3];
for i = 0 to 3 {
for j = 0 to 3 {
arr2[i, j] = arr1[3 - i, 3 - j];
}
}
let arr3 : i32[3, 3];
for i = 0 to 3 {
for j = 0 to 3 {
arr3[i, j] = arr2[i, j] + 7;
}
}
return arr3;
}
......@@ -5,6 +5,7 @@ dce(*);
let out = auto-outline(*);
gpu(out.test1);
gpu(out.test2);
gpu(out.test3);
ip-sroa(*);
sroa(*);
......
......@@ -27,6 +27,11 @@ fn main() {
let output = r.run(3).await;
let correct = vec![24i32; 16];
assert(correct, output);
let mut r = runner!(test3);
let output = r.run(0).await;
let correct = vec![11, 10, 9, 10, 9, 8, 9, 8, 7];
assert(correct, output);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment