summaryrefslogtreecommitdiffstats
path: root/tests/serialization
diff options
context:
space:
mode:
Diffstat (limited to 'tests/serialization')
-rw-r--r--tests/serialization/obfuscated-check-loc.slang36
-rw-r--r--tests/serialization/obfuscated-check-loc.slang.expected6
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/serialization/obfuscated-check-loc.slang b/tests/serialization/obfuscated-check-loc.slang
new file mode 100644
index 000000000..8575a2650
--- /dev/null
+++ b/tests/serialization/obfuscated-check-loc.slang
@@ -0,0 +1,36 @@
+//TEST:SIMPLE:-target cpp -stage compute -entry computeMain -obfuscate -source-map -line-directive-mode none
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<float> outputBuffer;
+
+#if 0
+[DllExport]
+String getString()
+{
+ return "Hello!";
+}
+#endif
+
+int silly(int a)
+{
+ int t = 0;
+ [ForceUnroll(10)]
+ while ( a > 0)
+ {
+ t = t + t + a;
+ }
+ return t;
+}
+
+[numthreads(1, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int x = int(dispatchThreadID.x);
+
+ //String v = getString();
+ int v = silly(x);
+
+ outputBuffer[x] = v;
+
+}
+
diff --git a/tests/serialization/obfuscated-check-loc.slang.expected b/tests/serialization/obfuscated-check-loc.slang.expected
new file mode 100644
index 000000000..0743b437a
--- /dev/null
+++ b/tests/serialization/obfuscated-check-loc.slang.expected
@@ -0,0 +1,6 @@
+result code = -1
+standard error = {
+tests/serialization/obfuscated-check-loc.slang(18): error 40020: loop does not terminate within the limited number of iterations, unrolling is aborted.
+}
+standard output = {
+}