Add a runtime-disabled dialog element skeleton
[WebKit-https.git] / LayoutTests / webgpu / whlsl-vector-syntax.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.vectorTypeSyntax = async () =>
14 {
15     let program = `
16         int foo2()
17         {
18             int2 x;
19             vector<int, 2> z = int2(3, 4);
20             x = z;
21             return x.y;
22         }
23
24         int foo3()
25         {
26             int3 x;
27             vector<int, 3> z = int3(3, 4, 5);
28             x = z;
29             return x.z;
30         }
31
32         int foo4()
33         {
34             int4 x;
35             vector<int,4> z = int4(3, 4, 5, 6);
36             x = z;
37             return x.w;
38         }`;
39
40     assert_equals(await callIntFunction(program, "foo2", []), 4);
41     assert_equals(await callIntFunction(program, "foo3", []), 5);
42     assert_equals(await callIntFunction(program, "foo4", []), 6);
43
44     program = `
45         typedef i = int;
46         int foo2()
47         {
48             int2 x;
49             vector<i, 2> z = int2(3, 4);
50             x = z;
51             return x.y;
52         }`;
53
54     assert_equals(await callIntFunction(program, "foo2", []), 4);
55 }
56 runTests(whlslTests);
57 </script>
58 </html>