Add a runtime-disabled dialog element skeleton
[WebKit-https.git] / LayoutTests / webgpu / whlsl-array-length-spec-tests.html
1 <!DOCTYPE html>
2 <html>
3 <meta charset=utf-8>
4 <meta name="timeout" content="long">
5 <title>Test structs.</title>
6 <script src="js/whlsl-test-harness.js"></script>
7 <script src="js/webgpu-functions.js"></script>
8 <script src="../resources/testharness.js"></script>
9 <script src="../resources/testharnessreport.js"></script>
10 <script>
11 const whlslTests = {};
12
13 whlslTests.nonArrayRefArrayLengthFail = async () =>
14 {
15     await checkFail(
16         `
17             thread uint* lengthPtr()
18             {
19                 int[42] array;
20                 return &(array.length);
21             }
22         `);
23 }
24
25 whlslTests.nonArrayRefArrayLengthSucceed = async () =>
26 {
27     let program = `
28         uint foo()
29         {
30             float[754] array;
31             return array.length;
32         }
33         uint bar()
34         {
35             int[754] array;
36             return array.length;
37         }
38     `;
39     assert_equals(await callUintFunction(program, "foo", []), 754);
40     assert_equals(await callUintFunction(program, "bar", []), 754);
41 }
42
43 runTests(whlslTests);
44 </script>
45 </html>