summaryrefslogtreecommitdiffstats
path: root/tests/language-feature
diff options
context:
space:
mode:
Diffstat (limited to 'tests/language-feature')
-rw-r--r--tests/language-feature/overload-resolution-signed-unsigned.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/language-feature/overload-resolution-signed-unsigned.slang b/tests/language-feature/overload-resolution-signed-unsigned.slang
new file mode 100644
index 000000000..f8de85810
--- /dev/null
+++ b/tests/language-feature/overload-resolution-signed-unsigned.slang
@@ -0,0 +1,20 @@
+//TEST:SIMPLE(filecheck=CHECK): -target hlsl -stage compute -entry main
+RWStructuredBuffer<float> result;
+// CHECK-NOT: result{{.*}}[int(0)] = 1
+// CHECK: result{{.*}}[int(0)] = 2
+// CHECK-NOT: result{{.*}}[int(0)] = 1
+[numthreads(1,1,1)]
+void main()
+{
+ int ic = -1;
+ uint a = 2;
+ if (ic < a)
+ {
+ result[0] = 1;
+ }
+ else
+ {
+ // Should pick this branch according to C spec.
+ result[0] = 2;
+ }
+} \ No newline at end of file