diff options
Diffstat (limited to 'tests/diagnostics')
9 files changed, 58 insertions, 5 deletions
diff --git a/tests/diagnostics/syntax-error-intrinsic.slang.1.expected b/tests/diagnostics/syntax-error-intrinsic.slang.1.expected deleted file mode 100644 index 3c032078a..000000000 --- a/tests/diagnostics/syntax-error-intrinsic.slang.1.expected +++ /dev/null @@ -1 +0,0 @@ -18 diff --git a/tests/diagnostics/syntax-error-intrinsic.slang.2.expected b/tests/diagnostics/syntax-error-intrinsic.slang.2.expected deleted file mode 100644 index 3c032078a..000000000 --- a/tests/diagnostics/syntax-error-intrinsic.slang.2.expected +++ /dev/null @@ -1 +0,0 @@ -18 diff --git a/tests/diagnostics/syntax-error-intrinsic.slang.3.expected b/tests/diagnostics/syntax-error-intrinsic.slang.3.expected deleted file mode 100644 index 98d9bcb75..000000000 --- a/tests/diagnostics/syntax-error-intrinsic.slang.3.expected +++ /dev/null @@ -1 +0,0 @@ -17 diff --git a/tests/diagnostics/syntax-error-intrinsic.slang.4.expected b/tests/diagnostics/syntax-error-intrinsic.slang.4.expected deleted file mode 100644 index 98d9bcb75..000000000 --- a/tests/diagnostics/syntax-error-intrinsic.slang.4.expected +++ /dev/null @@ -1 +0,0 @@ -17 diff --git a/tests/diagnostics/syntax-error-intrinsic.slang.expected b/tests/diagnostics/syntax-error-intrinsic.slang.expected index 98d9bcb75..d6b24041c 100644 --- a/tests/diagnostics/syntax-error-intrinsic.slang.expected +++ b/tests/diagnostics/syntax-error-intrinsic.slang.expected @@ -1 +1 @@ -17 +19 diff --git a/tests/diagnostics/syntax-error-op-line-2.slang b/tests/diagnostics/syntax-error-op-line-2.slang new file mode 100644 index 000000000..994e875a1 --- /dev/null +++ b/tests/diagnostics/syntax-error-op-line-2.slang @@ -0,0 +1,33 @@ +// syntax-error-op-line-2.slang + +// NOTE! That although this is a 'diagnostic' like test, it tests using downstream compiler +// the downstream compiler being present is a requirement, so we mark as a 'TEST' so that +// those tests are made. + +//TEST:SIMPLE_LINE:-entry computeMain -target spirv +//TEST:SIMPLE_LINE:-entry computeMain -target dxil -profile cs_6_0 +//TEST:SIMPLE_LINE:-entry computeMain -target dxbc +//TEST:SIMPLE_LINE:-entry computeMain -target dll +//TEST:SIMPLE_LINE:-entry computeMain -target ptx + +// Here the thing being checked is error reporting around return, and += + +int doSomething(int a) +{ + a += a; + + return a + += + __SyntaxError(); +} + +[shader("compute")] +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int id = int(dispatchThreadID.x); + + int v = int(dispatchThreadID.y); + + v += doSomething(id); +}
\ No newline at end of file diff --git a/tests/diagnostics/syntax-error-op-line-2.slang.expected b/tests/diagnostics/syntax-error-op-line-2.slang.expected new file mode 100644 index 000000000..aabe6ec39 --- /dev/null +++ b/tests/diagnostics/syntax-error-op-line-2.slang.expected @@ -0,0 +1 @@ +21 diff --git a/tests/diagnostics/syntax-error-op-line.slang b/tests/diagnostics/syntax-error-op-line.slang new file mode 100644 index 000000000..eab15e4a4 --- /dev/null +++ b/tests/diagnostics/syntax-error-op-line.slang @@ -0,0 +1,22 @@ +// syntax-error-op-line.slang + +// NOTE! That although this is a 'diagnostic' like test, it tests using downstream compiler +// the downstream compiler being present is a requirement, so we mark as a 'TEST' so that +// those tests are made. + +//TEST:SIMPLE_LINE:-entry computeMain -target spirv +//TEST:SIMPLE_LINE:-entry computeMain -target dxil -profile cs_6_0 +//TEST:SIMPLE_LINE:-entry computeMain -target dxbc +//TEST:SIMPLE_LINE:-entry computeMain -target dll +//TEST:SIMPLE_LINE:-entry computeMain -target ptx + +[shader("compute")] +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int id = int(dispatchThreadID.x); + + int v = int(dispatchThreadID.y); + + v += id + __SyntaxError(); +}
\ No newline at end of file diff --git a/tests/diagnostics/syntax-error-op-line.slang.expected b/tests/diagnostics/syntax-error-op-line.slang.expected new file mode 100644 index 000000000..aabe6ec39 --- /dev/null +++ b/tests/diagnostics/syntax-error-op-line.slang.expected @@ -0,0 +1 @@ +21 |
