summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-10-21 15:32:13 -0400
committerGitHub <noreply@github.com>2019-10-21 15:32:13 -0400
commit5ca446888656da91165b7bf90b7b2195d1e1afac (patch)
tree893a03930bc706089f28c156032ffe883ea0d2a1 /tests
parenta854bf2fde6e466aa698f4132971faadc827913a (diff)
`Repro` functionality (#1085)
* WIP on serialize/save state. * Relative string encoding. * Added RelativeContainer unit test. Split out RelativeContainer into core. * Fix bug in RelativeString encoding. * More work around relative container. * Fix checks. * Use RelativeBase for safe access. Use malloc/free/realloc instead of List. * Add natvis support for relative types. * Setting up of state (not includes) writing of repro state. * Capture after spCompile. * Writing SourceFile and file system files. Added -dump-repo * First pass at loading state. * First pass at reading repro. * Small optimization around Safe32Ptr * Refactor how repro data is stored - to make saving off the files more simple, by having all all backed by 'files'. Make file loading always set up PathInfo so we get uniqueIdentifier info. * Generate unique file names. * Added RelativeFileSystem Added saveFile to ISlangFileSystemExt and implemented for interfaces Added mechanism to save of files (and manifest) * Added ability to replace files in repo with directory holding their contents. * Add support for entry points. * Fix problem compiling on linux. * Added SIMPLE_EX option, where everything on command line must be specified. * Fix typo in unit test for relative container. * Fix another typo in unit test for RelativeContainer. * Fix small bugs. * Fix release unused variable issue in slang-state-serialize.cpp * Fix checking for SIMPLE_EX in testing, else broke COMMAND_LINE_SIMPLE. * Fix warnings on 32 bit debug build. * Added import-subdir-search-path-repro.slang test. Although disabled for now as writes to root of slang project. * Remove wrong version of import-subdir-search-path-repro.slang * Added import-subdir-search-path-repro.slang
Diffstat (limited to 'tests')
-rw-r--r--tests/compute/dump-repro.slang31
-rw-r--r--tests/front-end/import-subdir-search-path-repro.slang12
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/compute/dump-repro.slang b/tests/compute/dump-repro.slang
new file mode 100644
index 000000000..eebe04852
--- /dev/null
+++ b/tests/compute/dump-repro.slang
@@ -0,0 +1,31 @@
+//TEST(compute):SIMPLE:-target hlsl -dump-repro repro.slang-repro
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):dxbinding(0),glbinding(0),out,name outputBuffer
+RWStructuredBuffer<int> outputBuffer;
+
+//TEST_INPUT:array(size=2):name g_aoa
+RWStructuredBuffer<int> g_aoa[];
+
+//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4):name=g_aoa[0]
+//TEST_INPUT:ubuffer(data=[8 17 34], stride=4):name=g_aoa[1]
+
+[numthreads(8, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int index = int(dispatchThreadID.x);
+
+ int baseIndex = index >> 2;
+ int innerIndex = index & 3;
+
+ RWStructuredBuffer<int> buffer = g_aoa[baseIndex];
+
+ // Get the size
+ uint bufferCount, bufferStride;
+ buffer.GetDimensions(bufferCount, bufferStride);
+
+ if (innerIndex >= bufferCount)
+ {
+ innerIndex = bufferCount - 1;
+ }
+ outputBuffer[index] = buffer[innerIndex];
+} \ No newline at end of file
diff --git a/tests/front-end/import-subdir-search-path-repro.slang b/tests/front-end/import-subdir-search-path-repro.slang
new file mode 100644
index 000000000..2978933fa
--- /dev/null
+++ b/tests/front-end/import-subdir-search-path-repro.slang
@@ -0,0 +1,12 @@
+//DISABLE_TEST:SIMPLE: -Itests/front-end/subdir -dump-repro import-subdir-search-path-repro.slang-repro
+//DISABLE_TEST:SIMPLE_EX: -extract-repro import-subdir-search-path-repro.slang-repro
+//DISABLE_TEST:SIMPLE: -load-repro import-subdir-search-path-repro.slang-repro
+
+// Confirming import lookup via search paths work
+
+__import import_subdir_a;
+
+// Should realize it's the same thing
+__import subdir.import_subdir_a;
+
+float bar(float x) { return foo(x); } \ No newline at end of file