summaryrefslogtreecommitdiff
path: root/tests/serialization/obfuscated-module-check-loc.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/serialization/obfuscated-module-check-loc.slang')
-rw-r--r--tests/serialization/obfuscated-module-check-loc.slang29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/serialization/obfuscated-module-check-loc.slang b/tests/serialization/obfuscated-module-check-loc.slang
new file mode 100644
index 000000000..f603d5403
--- /dev/null
+++ b/tests/serialization/obfuscated-module-check-loc.slang
@@ -0,0 +1,29 @@
+//TEST:COMPILE: tests/serialization/obfuscated-loc-module.slang -o tests/serialization/obfuscated-loc-module.zip -g -obfuscate -source-map
+//TEST:SIMPLE:-target hlsl -stage compute -entry computeMain -obfuscate -r tests/serialization/obfuscated-loc-module.zip
+//TEST:COMPILE: tests/serialization/obfuscated-loc-module.slang -o tests/serialization/obfuscated-loc-module.zip -g -obfuscate
+// Disable for now as it breaks on gcc/release as different hash seems to be produced
+//DISABLE_TEST:SIMPLE:-target hlsl -stage compute -entry computeMain -obfuscate -r tests/serialization/obfuscated-loc-module.zip
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<float> outputBuffer;
+
+// This test checks obfuscated source map loc tracking through a round trip, and producing a location correctly from slang-module that has a source map
+
+// We *don't* import because if we do we'll get a fresh compilation from source... we want to make sure it's using the -r module
+//import obfuscated_loc_module;
+int silly(int v);
+int billy(int v);
+
+[numthreads(1, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int x = int(dispatchThreadID.x);
+
+ x = billy(x);
+
+ // Will produce an error, because silly has an error.
+ int v = silly(x);
+
+ outputBuffer[x] = v;
+}
+