summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-04 15:20:21 -0400
committerYong He <yonghe@outlook.com>2017-11-04 15:20:21 -0400
commit31e7f84484d227206f3bbb33a8b9be8a9acecfe5 (patch)
treeeb06912348d3fd39a671308d80db999d144ae024 /tests
parentd803bf74eee7842ce8a358e145b2546c03308dfc (diff)
Passing both assoctype-simple and assoctype-complex test cases.
Diffstat (limited to 'tests')
-rw-r--r--tests/compute/assoctype-complex.slang9
-rw-r--r--tests/compute/assoctype-complex.slang.expected.txt4
-rw-r--r--tests/compute/generics-constraint1.slang17
-rw-r--r--tests/compute/generics-constructor.slang.expected.txt4
4 files changed, 14 insertions, 20 deletions
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<float> outputBuffer;
+RWStructuredBuffer<int> 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<Simple>(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<float> outputBuffer;
-
-__generic<T:__BuiltinFloatingPointType>
-T test(T v0, T v1)
-{
- return v0;
-}
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- float outVal = test<float>(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