| <!DOCTYPE html> |
| <html> |
| <meta charset=utf-8> |
| <meta name="timeout" content="long"> |
| <title>Test prefix/postfix.</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 = {}; |
| const epsilon = 0.0001; |
| |
| whlslTests.vectorIndexAssign = async () => { |
| const program = ` |
| int foo() { |
| int2 x; |
| x[0] = 20; |
| x[1] = 10; |
| x[5000] = 40; |
| return x.x / x.y + x[5000]; |
| } |
| `; |
| assert_equals(await callIntFunction(program, "foo", []), 40 / 10 + 40); |
| }; |
| |
| runTests(whlslTests); |
| </script> |
| </html> |