summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/gh-3997.slang23
-rw-r--r--tests/language-feature/non-copyable-return.slang4
-rw-r--r--tests/pipeline/rasterization/mesh/task-simple.slang5
3 files changed, 30 insertions, 2 deletions
diff --git a/tests/bugs/gh-3997.slang b/tests/bugs/gh-3997.slang
new file mode 100644
index 000000000..8c75da426
--- /dev/null
+++ b/tests/bugs/gh-3997.slang
@@ -0,0 +1,23 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -O0 -g
+
+//CHECK: OpEntryPoint
+
+float atomicAdd(__ref float value, float amount)
+{
+ __target_switch
+ {
+ case cpp:
+ __requirePrelude("#include <atomic>");
+ __intrinsic_asm "std::atomic_ref(*$0).fetch_add($1)";
+ case spirv:
+ return __atomicAdd(value, amount);
+ }
+}
+
+RWStructuredBuffer<float> outputBuffer;
+
+[numthreads(4, 1, 1)]
+[shader("compute")]
+void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) {
+ atomicAdd(outputBuffer[0], 1);
+} \ No newline at end of file
diff --git a/tests/language-feature/non-copyable-return.slang b/tests/language-feature/non-copyable-return.slang
index 20330c5f9..9b280b982 100644
--- a/tests/language-feature/non-copyable-return.slang
+++ b/tests/language-feature/non-copyable-return.slang
@@ -31,7 +31,7 @@ void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
{
let f = myFunc0(2.0);
// CHECK: 4.0
- // GLSL: void myFunc1_0(float y{{.*}}, spirv_by_reference MyType_0 {{.*}})
- // GLSL: void myFunc0_0(float x{{.*}}, spirv_by_reference MyType_0 {{.*}})
+ // GLSL: main(
+ // GLSL-NOT: MyType {{.*}} =
outputBuffer[0] = f.x;
}
diff --git a/tests/pipeline/rasterization/mesh/task-simple.slang b/tests/pipeline/rasterization/mesh/task-simple.slang
index dc3de82c0..2b2f3d186 100644
--- a/tests/pipeline/rasterization/mesh/task-simple.slang
+++ b/tests/pipeline/rasterization/mesh/task-simple.slang
@@ -1,6 +1,11 @@
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK): -task -output-using-type -dx12 -use-dxil -profile sm_6_6 -render-features mesh-shader
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK): -task -output-using-type -vk -profile glsl_450+spirv_1_4 -render-features mesh-shader
//TEST:SIMPLE(filecheck=HLSL):-target hlsl -entry meshMain -stage mesh
+//TEST:SIMPLE(filecheck=CHECK_SPV):-target spirv -entry taskMain -stage amplification
+
+// CHECK_SPV: OpEntryPoint
+// CHECK_SPV: TaskPayloadWorkgroupEXT
+
// To test a simple mesh shader, we'll generate 4 triangles, the vertices of
// each one will hold the triangle index and a value (the square). The fragment