Title: [247289] trunk/LayoutTests
Revision
247289
Author
[email protected]
Date
2019-07-09 17:23:19 -0700 (Tue, 09 Jul 2019)

Log Message

[WHLSL] Import another round of JS spec tests
https://bugs.webkit.org/show_bug.cgi?id=199647

Reviewed by Myles C. Maxfield.

This patch also removes the unneded <!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
comments in various tests.

* webgpu/bind-groups.html:
* webgpu/blit-commands.html:
* webgpu/map-read-buffers.html:
* webgpu/map-write-buffers.html:
* webgpu/msl-harness-test.html:
* webgpu/pipeline-layouts.html:
* webgpu/queue-creation.html:
* webgpu/render-command-encoding.html:
* webgpu/shader-modules.html:
* webgpu/textures-textureviews.html:
* webgpu/whlsl-array-spec-tests.html:
* webgpu/whlsl-bad-ander-expected.txt: Added.
* webgpu/whlsl-bad-ander.html: Added.
* webgpu/whlsl-bad-literals-expected.txt: Added.
* webgpu/whlsl-bad-literals.html: Added.
* webgpu/whlsl-bitwise-bool-ops.html:
* webgpu/whlsl-enum-spec-tests.html:
* webgpu/whlsl-equality.html:
* webgpu/whlsl-float-math-expected.txt: Added.
* webgpu/whlsl-float-math.html: Added.
* webgpu/whlsl-index-getter-setter-expected.txt: Added.
* webgpu/whlsl-index-getter-setter.html: Added.
* webgpu/whlsl-int-bit-math-expected.txt: Added.
* webgpu/whlsl-int-bit-math.html: Added.
* webgpu/whlsl-int-literal-compare.html:
* webgpu/whlsl-make-array-ref-spec-tests-expected.txt: Added.
* webgpu/whlsl-make-array-ref-spec-tests.html: Added.
* webgpu/whlsl-matrices-spec-tests.html:
* webgpu/whlsl-pointer-spec-tests-expected.txt: Added.
* webgpu/whlsl-pointer-spec-tests.html: Added.
* webgpu/whlsl-postfix-prefix-expected.txt: Added.
* webgpu/whlsl-postfix-prefix.html: Added.
* webgpu/whlsl-return-spec-tests.html:
* webgpu/whlsl-simple-getter-setter.html:
* webgpu/whlsl-simple-tests.html:
* webgpu/whlsl-simple-while-loop.html:
* webgpu/whlsl-test-harness-test.html:
* webgpu/whlsl-type-mismatch.html:
* webgpu/whlsl-uint-bitwise.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (247288 => 247289)


--- trunk/LayoutTests/ChangeLog	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/ChangeLog	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,3 +1,53 @@
+2019-07-09  Saam Barati  <[email protected]>
+
+        [WHLSL] Import another round of JS spec tests
+        https://bugs.webkit.org/show_bug.cgi?id=199647
+
+        Reviewed by Myles C. Maxfield.
+
+        This patch also removes the unneded <!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+        comments in various tests.
+
+        * webgpu/bind-groups.html:
+        * webgpu/blit-commands.html:
+        * webgpu/map-read-buffers.html:
+        * webgpu/map-write-buffers.html:
+        * webgpu/msl-harness-test.html:
+        * webgpu/pipeline-layouts.html:
+        * webgpu/queue-creation.html:
+        * webgpu/render-command-encoding.html:
+        * webgpu/shader-modules.html:
+        * webgpu/textures-textureviews.html:
+        * webgpu/whlsl-array-spec-tests.html:
+        * webgpu/whlsl-bad-ander-expected.txt: Added.
+        * webgpu/whlsl-bad-ander.html: Added.
+        * webgpu/whlsl-bad-literals-expected.txt: Added.
+        * webgpu/whlsl-bad-literals.html: Added.
+        * webgpu/whlsl-bitwise-bool-ops.html:
+        * webgpu/whlsl-enum-spec-tests.html:
+        * webgpu/whlsl-equality.html:
+        * webgpu/whlsl-float-math-expected.txt: Added.
+        * webgpu/whlsl-float-math.html: Added.
+        * webgpu/whlsl-index-getter-setter-expected.txt: Added.
+        * webgpu/whlsl-index-getter-setter.html: Added.
+        * webgpu/whlsl-int-bit-math-expected.txt: Added.
+        * webgpu/whlsl-int-bit-math.html: Added.
+        * webgpu/whlsl-int-literal-compare.html:
+        * webgpu/whlsl-make-array-ref-spec-tests-expected.txt: Added.
+        * webgpu/whlsl-make-array-ref-spec-tests.html: Added.
+        * webgpu/whlsl-matrices-spec-tests.html:
+        * webgpu/whlsl-pointer-spec-tests-expected.txt: Added.
+        * webgpu/whlsl-pointer-spec-tests.html: Added.
+        * webgpu/whlsl-postfix-prefix-expected.txt: Added.
+        * webgpu/whlsl-postfix-prefix.html: Added.
+        * webgpu/whlsl-return-spec-tests.html:
+        * webgpu/whlsl-simple-getter-setter.html:
+        * webgpu/whlsl-simple-tests.html:
+        * webgpu/whlsl-simple-while-loop.html:
+        * webgpu/whlsl-test-harness-test.html:
+        * webgpu/whlsl-type-mismatch.html:
+        * webgpu/whlsl-uint-bitwise.html:
+
 2019-07-09  Ryan Haddad  <[email protected]>
 
         Unreviewed test gardening, address TestExpectations linter warning.

Modified: trunk/LayoutTests/webgpu/bind-groups.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/bind-groups.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/bind-groups.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Create a basic GPUBindGroup.</title>
 <body>

Modified: trunk/LayoutTests/webgpu/blit-commands.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/blit-commands.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/blit-commands.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset="utf-8">
 <title>Basic Blitting</title>
 <meta name="assert" content="Blit operations copy a green canvas.">

Modified: trunk/LayoutTests/webgpu/map-read-buffers.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/map-read-buffers.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/map-read-buffers.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Tests for createBufferMapped and mapReadAsync on a GPUBuffer.</title>
 <body>

Modified: trunk/LayoutTests/webgpu/map-write-buffers.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/map-write-buffers.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/map-write-buffers.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Tests for mapWriteAsync on a GPUBuffer.</title>
 <body>

Modified: trunk/LayoutTests/webgpu/msl-harness-test.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/msl-harness-test.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/msl-harness-test.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <title>Test the WHLSL test harness.</title>

Modified: trunk/LayoutTests/webgpu/pipeline-layouts.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/pipeline-layouts.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/pipeline-layouts.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Create GPUBindGroupLayout.</title>
 <body>

Modified: trunk/LayoutTests/webgpu/queue-creation.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/queue-creation.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/queue-creation.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Get the GPUDevice and ask for the GPUQueue</title>
 <body>

Modified: trunk/LayoutTests/webgpu/render-command-encoding.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/render-command-encoding.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/render-command-encoding.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Get the GPUDevice and ask for the GPUQueue</title>
 <body>

Modified: trunk/LayoutTests/webgpu/shader-modules.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/shader-modules.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/shader-modules.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <title>Test shader validation.</title>

Modified: trunk/LayoutTests/webgpu/textures-textureviews.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/textures-textureviews.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/textures-textureviews.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <meta charset=utf-8>
 <title>Basic GPUTexture Tests.</title>
 <body>

Modified: trunk/LayoutTests/webgpu/whlsl-array-spec-tests.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-array-spec-tests.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-array-spec-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Added: trunk/LayoutTests/webgpu/whlsl-bad-ander-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-bad-ander-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-bad-ander-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,9 @@
+
+PASS indexAnderDoesntReturnPointer 
+PASS indexAnderDoesntTakeReference 
+PASS anderDoesntReturnPointer 
+PASS anderDoesntTakeReference 
+PASS anderWithBadIndex 
+PASS anderWithNothingWrong 
+PASS anderWithWrongNumberOfArguments 
+

Added: trunk/LayoutTests/webgpu/whlsl-bad-ander.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-bad-ander.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-bad-ander.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test prefix/postfix.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.indexAnderDoesntReturnPointer = async () =>
+{
+    await checkFail(
+        `
+            struct Foo {
+                int x;
+            }
+            int operator&[](thread Foo* foo, uint)
+            {
+                return foo->x;
+            }
+        `);
+}
+
+whlslTests.indexAnderDoesntTakeReference = async () =>
+{
+    await checkFail(
+        `
+            struct Foo {
+                int x;
+            }
+            thread int* operator&[](Foo foo, uint)
+            {
+                return &foo.x;
+            }
+        `);
+}
+
+whlslTests.anderDoesntReturnPointer = async () => {
+    await checkFail(
+        `
+            struct Foo {
+                int x;
+            }
+            int operator&.foo(thread Foo* foo)
+            {
+                return foo->x;
+            }
+        `);
+}
+
+whlslTests.anderDoesntTakeReference = async () =>
+{
+    await checkFail(
+        `
+            struct Foo {
+                int x;
+            }
+            thread int* operator&.foo(Foo foo)
+            {
+                return &foo.x;
+            }
+        `);
+}
+
+whlslTests.anderWithBadIndex = async () =>
+{
+    await checkFail(`int foo(thread int[] x) { return x[-1]; }`);
+
+    await checkFail(`int foo(thread int[] x) { return x[1.f]; }`);
+
+    await checkFail(`int foo(thread int[] x, int y) { return x[y]; }`);
+
+    await checkFail(`int foo(thread int[] x, float y) { return x[y]; }`);
+}
+
+whlslTests.anderWithNothingWrong = async () =>
+{
+    let program = `
+        struct Foo {
+            int x;
+        }
+        thread int* operator&.foo(thread Foo* foo)
+        {
+            return &foo->x;
+        }
+        int foo()
+        {
+            Foo x;
+            x.x = 13;
+            return x.foo;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", []), 13);
+}
+
+whlslTests.anderWithWrongNumberOfArguments = async () => {
+    await checkFail(
+        `
+            thread int* operator&.foo()
+            {
+                int x;
+                return &x;
+            }
+        `);
+
+    await checkFail(
+        `
+            struct Foo {
+                int x;
+            }
+            thread int* operator&.foo(thread Foo* foo, int blah)
+            {
+                return &foo->x;
+            }
+        `);
+}
+
+runTests(whlslTests);
+</script>
+</html>

Added: trunk/LayoutTests/webgpu/whlsl-bad-literals-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-bad-literals-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-bad-literals-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,4 @@
+
+PASS badIntLiteralForInt 
+PASS badIntLiteralForFloat 
+

Added: trunk/LayoutTests/webgpu/whlsl-bad-literals.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-bad-literals.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-bad-literals.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test prefix/postfix.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.badIntLiteralForInt = async () =>
+{
+    await checkFail( "void foo() { int x = 3000000000; }");
+}
+
+whlslTests.badIntLiteralForFloat = async () =>
+{
+    await checkFail("void foo() { float x = 5000000000000000000000000000000000000; }");
+}
+
+runTests(whlslTests);
+</script>
+</html>

Modified: trunk/LayoutTests/webgpu/whlsl-bitwise-bool-ops.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-bitwise-bool-ops.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-bitwise-bool-ops.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-enum-spec-tests.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-enum-spec-tests.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-enum-spec-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-equality.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-equality.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-equality.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Added: trunk/LayoutTests/webgpu/whlsl-float-math-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-float-math-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-float-math-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,3 @@
+
+PASS floatMath 
+

Added: trunk/LayoutTests/webgpu/whlsl-float-math.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-float-math.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-float-math.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test prefix/postfix.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.floatMath = async () => {
+    let program = `
+        bool foo()
+        {
+            return 42.5 == 42.5;
+        }
+        float bar(float x)
+        {
+            return x;
+        }
+        float foo6()
+        {
+            return bar(7.5);
+        }
+        float foo9()
+        {
+            return float(7.5);
+        }
+        float foo12()
+        {
+            return float(7);
+        }
+        float foo13()
+        {
+            float x = 7.5;
+            return float(x);
+        }
+    `;
+
+    assert_equals(await callBoolFunction(program,  "foo", []), true);
+    assert_equals(await callFloatFunction(program, "foo6", []), 7.5);
+    assert_equals(await callFloatFunction(program, "foo9", []), 7.5);
+    assert_equals(await callFloatFunction(program, "foo12", []), 7);
+    assert_equals(await callFloatFunction(program, "foo13", []), 7.5);
+
+    await checkFail(
+        `
+            int bar(int x)
+            {
+                return x;
+            }
+            int foo()
+            {
+                bar(4.0);
+            }
+        `);
+
+    await checkFail(
+        `
+            int bar(int x)
+            {
+                return x;
+            }
+            int foo()
+            {
+                bar(4.0f);
+            }
+        `);
+
+    await checkFail(
+        `
+            uint bar(uint x)
+            {
+                return x;
+            }
+            int foo()
+            {
+                bar(4.0);
+            }
+        `);
+
+    await checkFail(
+        `
+            uint bar(uint x)
+            {
+                return x;
+            }
+            int foo()
+            {
+                bar(4.0f);
+            }
+        `);
+}
+
+runTests(whlslTests);
+</script>
+</html>

Added: trunk/LayoutTests/webgpu/whlsl-index-getter-setter-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-index-getter-setter-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-index-getter-setter-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,4 @@
+
+PASS pointerIndexGetter 
+PASS pointerGetter 
+

Added: trunk/LayoutTests/webgpu/whlsl-index-getter-setter.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-index-getter-setter.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-index-getter-setter.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test the WHLSL test harness.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.pointerIndexGetter = async () => {
+    await checkFail(
+        `
+            int operator[](device int*, uint)
+            {
+                return 543;
+            }
+        `);
+
+    await checkFail(
+        `
+            int operator[](thread int*, uint)
+            {
+                return 543;
+            }
+        `);
+
+    await checkFail(
+        `
+            int operator[](threadgroup int*, uint)
+            {
+                return 543;
+            }
+        `);
+
+    await checkFail(
+        `
+            int operator[](constant int*, uint)
+            {
+                return 543;
+            }
+        `);
+}
+
+whlslTests.pointerGetter = async () => {
+    await checkFail(
+        `
+            int operator.foo(device int*)
+            {
+                return 543;
+            }
+        `);
+    await checkFail(
+        `
+            int operator.foo(thread int*)
+            {
+                return 543;
+            }
+        `);
+    await checkFail(
+        `
+            int operator.foo(threadgroup int*)
+            {
+                return 543;
+            }
+        `);
+    await checkFail(
+        `
+            int operator.foo(constant int*)
+            {
+                return 543;
+            }
+        `);
+}
+
+
+runTests(whlslTests);
+</script>
+</html>

Added: trunk/LayoutTests/webgpu/whlsl-int-bit-math-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-int-bit-math-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-int-bit-math-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,9 @@
+
+PASS intBitAnd 
+PASS intBitOr 
+PASS intBitXor 
+PASS intBitNot 
+PASS intLShift 
+PASS intRShift 
+PASS intSimpleMath 
+

Added: trunk/LayoutTests/webgpu/whlsl-int-bit-math.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-int-bit-math.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-int-bit-math.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test int bit math.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.intBitAnd = async () =>
+{
+    let program = `
+        int foo(int a, int b)
+        {
+            return a & b;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(1), makeInt(7)]), 1);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(65535), makeInt(42)]), 42);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(-1), makeInt(-7)]), -7);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(0), makeInt(85732)]), 0);
+}
+
+whlslTests.intBitOr = async () =>
+{
+    let program = `
+        int foo(int a, int b)
+        {
+            return a | b;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(1), makeInt(7)]), 7);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(65535), makeInt(42)]), 65535);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(-1), makeInt(-7)]), -1);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(0), makeInt(85732)]), 85732);
+}
+
+whlslTests.intBitXor = async () =>
+{
+    let program = `
+        int foo(int a, int b)
+        {
+            return a ^ b;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(1), makeInt(7)]), 6);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(65535), makeInt(42)]), 65493);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(-1), makeInt(-7)]), 6);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(0), makeInt(85732)]), 85732);
+}
+
+whlslTests.intBitNot = async () =>
+{
+    let program = `
+        int foo(int a)
+        {
+            return ~a;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(1)]), -2);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(65535)]), -65536);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(-1)]), 0);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(0)]), -1);
+}
+
+whlslTests.intLShift = async () =>
+{
+    let program = `
+        int foo(int a, uint b)
+        {
+            return a << b;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(1), makeUint(7)]), 128);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(65535), makeUint(2)]), 262140);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(-1), makeUint(5)]), -32);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(0), makeUint(3)]), 0);
+}
+
+whlslTests.intRShift = async () =>
+{
+    let program = `
+        int foo(int a, uint b)
+        {
+            return a >> b;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(1), makeUint(7)]), 0);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(65535), makeUint(2)]), 16383);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(-1), makeUint(5)]), -1);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(0), makeUint(3)]), 0);
+}
+
+whlslTests.intSimpleMath = async () => {
+    let program = "int foo(int x, int y) { return x + y; }";
+    assert_equals(await callIntFunction(program, "foo", [makeInt(7), makeInt(5)]), 12);
+    program = "int foo(int x, int y) { return x - y; }";
+    assert_equals(await callIntFunction(program, "foo", [makeInt(7), makeInt(5)]), 2);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(5), makeInt(7)]), -2);
+    program = "int foo(int x, int y) { return x * y; }";
+    assert_equals(await callIntFunction(program, "foo", [makeInt(7), makeInt(5)]), 35);
+    assert_equals(await callIntFunction(program, "foo", [makeInt(7), makeInt(-5)]), -35);
+}
+
+runTests(whlslTests);
+</script>
+</html>

Modified: trunk/LayoutTests/webgpu/whlsl-int-literal-compare.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-int-literal-compare.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-int-literal-compare.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Added: trunk/LayoutTests/webgpu/whlsl-make-array-ref-spec-tests-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-make-array-ref-spec-tests-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-make-array-ref-spec-tests-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,5 @@
+
+PASS makeArrayRefFromArrayRef 
+PASS makeArrayRefFromLocal 
+PASS makeArrayRefFromPointer 
+

Added: trunk/LayoutTests/webgpu/whlsl-make-array-ref-spec-tests.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-make-array-ref-spec-tests.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-make-array-ref-spec-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test the WHLSL test harness.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.makeArrayRefFromArrayRef = async () => {
+    await checkFail(
+        `
+            int bar(thread int[] ref)
+            {
+                return ref[0];
+            }
+            int baz(thread int[] ptr)
+            {
+                return bar(@ptr);
+            }
+            int foo()
+            {
+                int x = 48;
+                return baz(@x);
+            }
+        `);
+}
+
+whlslTests.makeArrayRefFromLocal = async () =>
+{
+    let program = `
+        int bar(thread int[] ref)
+        {
+            return ref[0];
+        }
+        int foo()
+        {
+            int x = 48;
+            return bar(@x);
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", []), 48);
+}
+
+whlslTests.makeArrayRefFromPointer = async () =>
+{
+    let program = `
+        int bar(thread int[] ref)
+        {
+            return ref[0];
+        }
+        int baz(thread int* ptr)
+        {
+            return bar(@ptr);
+        }
+        int foo()
+        {
+            int x = 48;
+            return baz(&x);
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", []), 48);
+}
+
+runTests(whlslTests);
+</script>
+</html>

Modified: trunk/LayoutTests/webgpu/whlsl-matrices-spec-tests.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-matrices-spec-tests.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-matrices-spec-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Added: trunk/LayoutTests/webgpu/whlsl-pointer-spec-tests-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-pointer-spec-tests-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-pointer-spec-tests-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,4 @@
+
+PASS pointerToPointer 
+PASS pointerToMember 
+

Added: trunk/LayoutTests/webgpu/whlsl-pointer-spec-tests.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-pointer-spec-tests.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-pointer-spec-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test the WHLSL test harness.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.pointerToPointer = async () =>
+{
+    let program = `
+        int foo()
+        {
+            int x;
+            thread int* p = &x;
+            thread int** pp = &p;
+            int*thread*thread qq = pp;
+            int result = 0;
+            x = 42;
+            *p = 76;
+            result += x;
+            **pp = 39;
+            result += x;
+            **qq = 83;
+            result += x;
+            return result;
+        }
+    `;;
+    assert_equals(await callIntFunction(program, "foo", []), 76 + 39 + 83);
+}
+
+whlslTests.pointerToMember = async () =>
+{
+    await checkFail(
+        `
+            void foo()
+            {
+                float3 x;
+                thread float* y = &x[1];
+            }
+        `);
+
+    await checkFail(
+        `
+            void foo()
+            {
+                float3x3 x;
+                thread float3* y = &x[1];
+            }
+        `);
+}
+
+runTests(whlslTests);
+</script>
+</html>

Added: trunk/LayoutTests/webgpu/whlsl-postfix-prefix-expected.txt (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-postfix-prefix-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-postfix-prefix-expected.txt	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,16 @@
+
+PASS prefixPlusPlus 
+PASS prefixPlusPlusResult 
+PASS postfixPlusPlus 
+PASS postfixPlusPlusResult 
+PASS prefixMinusMinus 
+PASS prefixMinusMinusResult 
+PASS postfixMinusMinus 
+PASS postfixMinusMinusResult 
+PASS plusEquals 
+PASS plusEqualsResult 
+PASS minusEquals 
+PASS minusEqualsResult 
+PASS timesEquals 
+PASS timesEqualsResult 
+

Added: trunk/LayoutTests/webgpu/whlsl-postfix-prefix.html (0 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-postfix-prefix.html	                        (rev 0)
+++ trunk/LayoutTests/webgpu/whlsl-postfix-prefix.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<meta name="timeout" content="long">
+<title>Test prefix/postfix.</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+const whlslTests = {};
+
+whlslTests.prefixPlusPlus = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            ++x;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 65);
+}
+
+whlslTests.prefixPlusPlusResult = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            return ++x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 65);
+}
+
+whlslTests.postfixPlusPlus = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            x++;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 65);
+}
+
+whlslTests.postfixPlusPlusResult = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            return x++;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 64);
+}
+
+whlslTests.prefixMinusMinus = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            --x;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 63);
+}
+
+whlslTests.prefixMinusMinusResult = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            return --x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 63);
+}
+
+whlslTests.postfixMinusMinus = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            x--;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 63);
+}
+
+whlslTests.postfixMinusMinusResult = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            return x--;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(64)]), 64);
+}
+
+whlslTests.plusEquals = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            x += 42;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(385)]), 385 + 42);
+}
+
+whlslTests.plusEqualsResult = async () =>
+{
+    let program = `
+        int foo(int x)
+        {
+            return x += 42;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(385)]), 385 + 42);
+}
+
+whlslTests.minusEquals = async () => {
+    let program = `
+        int foo(int x)
+        {
+            x -= 42;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(385)]), 385 - 42);
+}
+
+whlslTests.minusEqualsResult = async () => {
+    let program = `
+        int foo(int x)
+        {
+            return x -= 42;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(385)]), 385 - 42);
+}
+
+whlslTests.timesEquals = async () => {
+    let program = `
+        int foo(int x)
+        {
+            x *= 42;
+            return x;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(385)]), 385 * 42);
+}
+
+whlslTests.timesEqualsResult = async () => {
+    let program = `
+        int foo(int x)
+        {
+            return x *= 42;
+        }
+    `;
+    assert_equals(await callIntFunction(program, "foo", [makeInt(385)]), 385 * 42);
+}
+
+runTests(whlslTests);
+</script>
+</html>

Modified: trunk/LayoutTests/webgpu/whlsl-return-spec-tests.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-return-spec-tests.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-return-spec-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-simple-getter-setter.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-simple-getter-setter.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-simple-getter-setter.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-simple-tests.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-simple-tests.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-simple-tests.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-simple-while-loop.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-simple-while-loop.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-simple-while-loop.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-test-harness-test.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-test-harness-test.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-test-harness-test.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-type-mismatch.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-type-mismatch.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-type-mismatch.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webgpu/whlsl-uint-bitwise.html (247288 => 247289)


--- trunk/LayoutTests/webgpu/whlsl-uint-bitwise.html	2019-07-10 00:13:01 UTC (rev 247288)
+++ trunk/LayoutTests/webgpu/whlsl-uint-bitwise.html	2019-07-10 00:23:19 UTC (rev 247289)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
+<!DOCTYPE html>
 <html>
 <meta charset=utf-8>
 <meta name="timeout" content="long">
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to