blob: cca09defde1888b6eb2a3330851486de02225715 [file] [log] [blame]
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>load/store to null.</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.storeNullArrayRef = async () => {
await checkFail(
`
void foo() { null[0] = 42; }
`);
}
whlslTests.loadNullArrayRef = async () => {
await checkFail(
`
void sink(thread int* x) { }
void foo() { sink(null[0]); }
`);
}
whlslTests.nullNamedAccess = async () => {
await checkFail(
`
void foo() { null->x; }
`);
}
whlslTests.nullNamedAccess2 = async () => {
await checkFail(
`
void foo() { null.x; }
`);
}
whlslTests.nullNamedAccessSink = async () => {
await checkFail(
`
void sink(int x) { }
void foo() { sink(null->x); }
`);
}
whlslTests.nullNamedAccessSink2 = async () => {
await checkFail(
`
void sink(int x) { }
void foo() { sink(null.x); }
`);
}
runTests(whlslTests);
</script>
</html>