blob: c8dc3bfb547271911f9d90fb0d0058404445a2e0 [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/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.simpleUnreachableCode = async () => {
await checkFail(
`
void foo()
{
return;
int x;
}
`);
}
whlslTests.simpleNoReturn = async () => {
await checkFail("int foo() { }");
}
whlslTests.simpleRecursiveStruct = async () => {
await checkFail(
`
struct Foo {
Foo foo;
}
`);
}
whlslTests.simpleRecursion = async () => {
await checkFail(
`
void foo(int x)
{
foo(x);
}
`);
}
whlslTests.simpleRecursion2 = async () => {
await checkFail(
`
int bar(int x) {
foo(x);
return x;
}
void foo(int x)
{
foo(bar(x));
}
`);
}
runTests(whlslTests);
</script>
</html>