summaryrefslogtreecommitdiffstats
path: root/tests/experiments
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-04-07 10:12:00 -0700
committerGitHub <noreply@github.com>2023-04-07 10:12:00 -0700
commitea15647ba6bccb5ac48de5f4b80b8c2769d69b8f (patch)
tree1c3568c821f1371afd15ad40507c6109377f452a /tests/experiments
parent0468cd0d1a8a1cff1d838a741b050ef11f6d7461 (diff)
Diagnose on attempt to specialize with interface type. (#2780)
* Diagnose on attempt to specialize with interface type. Fixes ##1445. * Enable fixed test. * Fix test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/experiments')
-rw-r--r--tests/experiments/generic/type-to-value-4.slang13
-rw-r--r--tests/experiments/generic/type-to-value-4.slang.expected.txt4
2 files changed, 10 insertions, 7 deletions
diff --git a/tests/experiments/generic/type-to-value-4.slang b/tests/experiments/generic/type-to-value-4.slang
index 741b30791..8d768b54b 100644
--- a/tests/experiments/generic/type-to-value-4.slang
+++ b/tests/experiments/generic/type-to-value-4.slang
@@ -1,4 +1,4 @@
-//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
+//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
/* Test here is to try and associate a value with a type
@@ -52,26 +52,25 @@ interface IGetE
static Enum getE();
};
-public struct A : IGetE
+struct A : IGetE
{
static Enum getE() { return Enum::A; }
};
-public struct B : IGetE
+struct B : IGetE
{
static Enum getE() { return Enum::B; }
};
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- int index = dispatchThreadID.x;
+{
// Err.. even though IGetE doesn't require an instanciation, not clear how to set it. So lets try with instanciation
B b;
IGetE g = b;
let e = g.getE();
-
+
outputBuffer[dispatchThreadID.x] = int(e);
-} \ No newline at end of file
+}
diff --git a/tests/experiments/generic/type-to-value-4.slang.expected.txt b/tests/experiments/generic/type-to-value-4.slang.expected.txt
new file mode 100644
index 000000000..98fb6a686
--- /dev/null
+++ b/tests/experiments/generic/type-to-value-4.slang.expected.txt
@@ -0,0 +1,4 @@
+1
+1
+1
+1