summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/glsl-intrinsic/atomic/invalidDest.slang25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/glsl-intrinsic/atomic/invalidDest.slang b/tests/glsl-intrinsic/atomic/invalidDest.slang
new file mode 100644
index 000000000..315321f88
--- /dev/null
+++ b/tests/glsl-intrinsic/atomic/invalidDest.slang
@@ -0,0 +1,25 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target glsl -DTARGET_GLSL
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -allow-glsl -stage compute -entry computeMain -target spirv -skip-spirv-validation -emit-spirv-directly -DTARGET_SPIRV
+#version 430
+
+uint notShared;
+
+void computeMain()
+{
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicAdd(notShared, 1u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicAnd(notShared, 1u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicCompSwap(notShared, 1u, 2u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicExchange(notShared, 1u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicMax(notShared, 1u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicMin(notShared, 1u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicOr(notShared, 1u);
+ // CHECK: ([[# @LINE+1]]): error 41403
+ atomicXor(notShared, 1u);
+}