-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start work on FileCheck based code generation tests
- Loading branch information
Showing
6 changed files
with
63 additions
and
42 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
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
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,15 @@ | ||
void main() { | ||
// CHECK: %0 = spirv.IAdd %cst1_si32, %cst2_si32 : si3 | ||
int a = 1 + 2; | ||
|
||
// CHECK: %2 = spirv.IAdd %cst1_ui32, %cst2_ui32 : ui32 | ||
uint c = 1u + 2u; | ||
|
||
// CHECK: %4 = spirv.FAdd %cst_f32, %cst_f32_0 : f32 | ||
float b = 1.0f + 2.0f; | ||
|
||
// CHECK: %6 = spirv.FAdd %cst_f64, %cst_f64_1 : f64 | ||
double d = 1.0lf + 2.0lf; | ||
|
||
return; | ||
} |
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,33 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
SHADERPULSE="../../build/shaderpulse-standalone" | ||
FILECHECK="../../llvm-project/build/bin/FileCheck" | ||
|
||
if [ ! -x "$SHADERPULSE" ]; then | ||
echo "Error: shaderpulse binary not found at $SHADERPULSE" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -x "$FILECHECK" ]; then | ||
echo "Error: FileCheck binary not found at $FILECHECK" | ||
exit 1 | ||
fi | ||
|
||
for TEST_FILE in *.glsl; do | ||
if [ ! -f "$TEST_FILE" ]; then | ||
echo "No .glsl files found in the current directory." | ||
exit 1 | ||
fi | ||
|
||
echo "Running test on $TEST_FILE" | ||
$SHADERPULSE "$TEST_FILE" --no-analyze | $FILECHECK "$TEST_FILE" | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Test passed for $TEST_FILE" | ||
else | ||
echo "Test failed for $TEST_FILE" | ||
exit 1 | ||
fi | ||
done |