summaryrefslogtreecommitdiffstats
path: root/tests/doc
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-02-23 12:36:46 -0500
committerGitHub <noreply@github.com>2021-02-23 12:36:46 -0500
commit55a5ccc559b34b8d2eb9c7b7a2d9efbae40619c2 (patch)
tree105e60200bc4f6ac13a1845b448886d777a7398a /tests/doc
parent4bf01b04cb6bf1df8d4fb2ec5eee0a912ec679dc (diff)
Documentation markup extraction (#1724)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP extracting source documentation. * WIP doc extraction. * More stuff around doc markup extraction. * More WIP around doc extraction. * Fix some indexing issues. * Initial doc extraction working. * Renaming of types in markup extraction process. * Extracting markup content. Removing indenting. Other fixes and improvements around document tools. * WIP support for documentation system. * Remove some commented out sections. * Remove some comments that no longer apply. * Improvements around SourceFile - such that more granularity around line ops. Made some functionality explicitly work without source. Improved Doc types nameing.
Diffstat (limited to 'tests/doc')
-rw-r--r--tests/doc/doc.slang74
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/doc/doc.slang b/tests/doc/doc.slang
new file mode 100644
index 000000000..a2298ec4c
--- /dev/null
+++ b/tests/doc/doc.slang
@@ -0,0 +1,74 @@
+//DISABLE_TEST:SIMPLE:-entry computeMain -target spirv -stage compute -doc
+
+ /// Let's test indent
+ ///
+ /// ```
+ /// {
+ /// imIndented();
+ /// }
+ /// ```
+ ///
+RWStructuredBuffer<int> inputBuffer;
+
+/// A struct with some fields
+struct SomeStruct
+{
+ /// A field
+ int aField;
+ /// Multi-line
+ /// is a thing
+ int anotherField;
+ int yetAnother; ///< A field with stuff
+};
+
+/// An enum
+enum AnEnum
+{
+ Value, ///< A value
+ /// Another value
+ /// With a multi-line comment
+ AnotherValue,
+};
+
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
+RWStructuredBuffer<int> outputBuffer; ///< An output buffer
+
+/// doThing!
+int doThing(int a, ///< a parameter
+ int b) ///< b parameter
+{
+ while (b >= 0)
+ {
+ a
+ +=
+ a;
+ }
+
+ return a;
+}
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int a = dispatchThreadID.x;
+ int b = dispatchThreadID.y;
+ int c = dispatchThreadID.z;
+ int d = a + b * c;
+ int e = d + c / 2;
+
+ for (int i = 0; i < b; ++i)
+ {
+ if (e > 10 && i & 2)
+ {
+ a += b; b -= c; c += c; d = d + e + a; e = a;
+ }
+ else
+ {
+ a = e; b = c + c; d += d + __SyntaxError(); e = doThing(e, dispatchThreadID.x);
+
+ }
+ }
+
+ outputBuffer[dispatchThreadID.x] = a + b + c + d + e;
+}