blob: 5aed2443c6d93d2be3bab9f762c6b6dbab944899 [file] [log] [blame]
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>Test the WHLSL test harness.</title>
<script src="js/whlsl-test-harness.js"></script>
<script src="js/webgpu-functions.js"></script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
const whlslTests = {};
whlslTests.typeMismatchReturn = async () =>
{
await checkFail(
`
int foo()
{
return 10.5;
}
`);
}
whlslTests.typeMismatchVariableDecl = async () =>
{
await checkFail(
`
void foo(uint x)
{
int y = x;
}
`);
}
whlslTests.typeMismatchAssignment = async () =>
{
await checkFail(
`
void foo(uint x)
{
int y;
y = x;
}
`);
}
whlslTests.typeMismatchReturnParam = async () =>
{
await checkFail(
`
int foo(uint x)
{
return x;
}
`);
}
runTests(whlslTests);
</script>
</html>