From 31e7f84484d227206f3bbb33a8b9be8a9acecfe5 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 4 Nov 2017 15:20:21 -0400 Subject: Passing both assoctype-simple and assoctype-complex test cases. --- tests/compute/assoctype-complex.slang | 9 ++++++--- tests/compute/assoctype-complex.slang.expected.txt | 4 ++++ tests/compute/generics-constraint1.slang | 17 ----------------- tests/compute/generics-constructor.slang.expected.txt | 4 ++++ 4 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 tests/compute/assoctype-complex.slang.expected.txt delete mode 100644 tests/compute/generics-constraint1.slang create mode 100644 tests/compute/generics-constructor.slang.expected.txt (limited to 'tests') diff --git a/tests/compute/assoctype-complex.slang b/tests/compute/assoctype-complex.slang index f29d231b6..16d6b1514 100644 --- a/tests/compute/assoctype-complex.slang +++ b/tests/compute/assoctype-complex.slang @@ -1,7 +1,7 @@ //TEST(smoke, compute):COMPARE_COMPUTE:-xslang -use-ir //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out -RWStructuredBuffer outputBuffer; +RWStructuredBuffer outputBuffer; interface IBase { associatedtype V; @@ -16,9 +16,10 @@ interface ISimple struct Val : IBase { typedef int V; + int base; V sub(V a0, V a1) { - return a0-a1; + return a0 - a1 + base; } }; @@ -42,6 +43,8 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { Simple s; Val v0, v1; - float outVal = test(s, v0, v1); // == 1.0 + v0.base = 1; + v1.base = 2; + int outVal = test(s, v0, v1); // == 4.0 outputBuffer[dispatchThreadID.x] = outVal; } \ No newline at end of file diff --git a/tests/compute/assoctype-complex.slang.expected.txt b/tests/compute/assoctype-complex.slang.expected.txt new file mode 100644 index 000000000..e43ad329a --- /dev/null +++ b/tests/compute/assoctype-complex.slang.expected.txt @@ -0,0 +1,4 @@ +4 +4 +4 +4 \ No newline at end of file diff --git a/tests/compute/generics-constraint1.slang b/tests/compute/generics-constraint1.slang deleted file mode 100644 index aa8d398e8..000000000 --- a/tests/compute/generics-constraint1.slang +++ /dev/null @@ -1,17 +0,0 @@ -//TEST(smoke, compute):COMPARE_COMPUTE:-xslang -use-ir -//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out - -RWStructuredBuffer outputBuffer; - -__generic -T test(T v0, T v1) -{ - return v0; -} - -[numthreads(4, 1, 1)] -void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) -{ - float outVal = test(1.0, 2.0); - outputBuffer[dispatchThreadID.x] = outVal; -} \ No newline at end of file diff --git a/tests/compute/generics-constructor.slang.expected.txt b/tests/compute/generics-constructor.slang.expected.txt new file mode 100644 index 000000000..e54af3bc8 --- /dev/null +++ b/tests/compute/generics-constructor.slang.expected.txt @@ -0,0 +1,4 @@ +40400000 +40400000 +40400000 +40400000 -- cgit v1.2.3