summaryrefslogtreecommitdiff
path: root/tests/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/addr-scope-fix.slang3
-rw-r--r--tests/bugs/generic-default-value.slang7
-rw-r--r--tests/bugs/gh-4863.slang4
-rw-r--r--tests/bugs/overload-ambiguous-2.slang2
4 files changed, 11 insertions, 5 deletions
diff --git a/tests/bugs/addr-scope-fix.slang b/tests/bugs/addr-scope-fix.slang
index 8a58b7daf..3b0059417 100644
--- a/tests/bugs/addr-scope-fix.slang
+++ b/tests/bugs/addr-scope-fix.slang
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type
+//TEST(compute):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj -output-using-type
//TEST_INPUT:ubuffer(data=[0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
@@ -73,4 +74,4 @@ void func(int x)
void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
{
func(4);
-} \ No newline at end of file
+}
diff --git a/tests/bugs/generic-default-value.slang b/tests/bugs/generic-default-value.slang
index 32dc07cdc..2a223e8c2 100644
--- a/tests/bugs/generic-default-value.slang
+++ b/tests/bugs/generic-default-value.slang
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
+//TEST(compute):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;
@@ -8,6 +9,10 @@ works with a generic */
struct Check<T>
{
+ // T is not default initialize type, because it's a generic type parameter.
+ // Therefore, when we synthesize the contructor, we won't create a default value
+ // for it.
+ // __init(T v);
T v;
};
@@ -16,7 +21,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
int index = int(dispatchThreadID.x);
- Check<float> v = {};
+ Check<float> v = {0};
outputBuffer[index] = index + int(v.v);
}
diff --git a/tests/bugs/gh-4863.slang b/tests/bugs/gh-4863.slang
index e1f4e1d2d..b1de7134f 100644
--- a/tests/bugs/gh-4863.slang
+++ b/tests/bugs/gh-4863.slang
@@ -29,8 +29,8 @@ void doThing(inout Foo foo, uint2 ipos)
[numthreads(1, 1, 1)]
void computeMain(uint2 ipos : SV_DispatchThreadID)
{
- Foo foo;
+ Foo foo = {};
doThing(foo, ipos);
// BUFFER: 3
outputBuffer[0] = (int)foo.bar1;
-} \ No newline at end of file
+}
diff --git a/tests/bugs/overload-ambiguous-2.slang b/tests/bugs/overload-ambiguous-2.slang
index 46af9f091..785db7b31 100644
--- a/tests/bugs/overload-ambiguous-2.slang
+++ b/tests/bugs/overload-ambiguous-2.slang
@@ -57,7 +57,7 @@ void computeMain(uint3 threadID: SV_DispatchThreadID)
{
using namespace A;
- Struct2<10> input = {threadID.x};
+ Struct2<10> input = {{threadID.x}};
Struct2<20> output;
output = myFunc<10, 20>(input);