-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an example LLVM FileCheck based test
Signed-off-by: Uday Bondhugula <udayb@iisc.ac.in>
- Loading branch information
1 parent
8fac862
commit 9280565
Showing
3 changed files
with
48 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,23 @@ | ||
#!/bin/bash | ||
|
||
TESTS=test/heat-2d.c | ||
|
||
for file in $TESTS; do | ||
echo -ne "$file " | ||
./src/pluto $file $* --pet --notile --noparallel -o test_temp_out.pluto.c | FileCheck $file | ||
if [ $? -ne 0 ]; then | ||
echo -e "[\e[31mFailed\e[0m]" " $file"! | ||
else | ||
echo -e "[\e[32mPassed\e[0m]" | ||
fi | ||
done | ||
|
||
cleanup() | ||
{ | ||
rm -f test_temp_out.pluto.c | ||
rm -f test_temp_out.pluto.pluto.cloog | ||
} | ||
|
||
echo | ||
|
||
trap cleanup SIGINT exit |
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,22 @@ | ||
// CHECK: T(S1): (t, t+i, t+j) | ||
#define N 4000L | ||
#define T 1000L | ||
|
||
/* Define our arrays */ | ||
double A[2][N+2][N+2]; | ||
|
||
int main(int argc, char * argv[]) { | ||
#pragma scop | ||
for (int t = 0; t < T; t++) { | ||
for (int i = 1; i < N+1; i++) { | ||
for (int j = 1; j < N+1; j++) { | ||
A[(t+1)%2][i][j] = 0.125 * (A[t%2][i+1][j] - 2.0 * A[t%2][i][j] + A[t%2][i-1][j]) | ||
+ 0.125 * (A[t%2][i][j+1] - 2.0 * A[t%2][i][j] + A[t%2][i][j-1]) | ||
+ A[t%2][i][j]; | ||
} | ||
} | ||
} | ||
#pragma endscop | ||
|
||
return 0; | ||
} |
Looks for
FileCheck
in/usr/lib64/llvm
. Ideally this has to be searched in$PATH
and$CLANG_PREFIX