diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-02-08 16:29:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-08 16:29:31 -0500 |
| commit | 891791edd182fdfcba60aaacd36eaa303296f2ff (patch) | |
| tree | eec7445b531ce5bca98fcd69d4326254f3d81310 /tests/diagnostics | |
| parent | df7548ef62c02b9ab1cc5addecaa6b6c150f2750 (diff) | |
Copy SourceLoc when inlining (#1692)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Copy source loc information when inlining.
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/syntax-error-op-line-3.slang | 41 | ||||
| -rw-r--r-- | tests/diagnostics/syntax-error-op-line-3.slang.expected | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/diagnostics/syntax-error-op-line-3.slang b/tests/diagnostics/syntax-error-op-line-3.slang new file mode 100644 index 000000000..d8b1fa600 --- /dev/null +++ b/tests/diagnostics/syntax-error-op-line-3.slang @@ -0,0 +1,41 @@ +// syntax-error-op-line-3.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 + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<int> outputBuffer; + +// Here the thing being checked is error reporting around return, and += + +[__unsafeForceInlineEarly] +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); + + outputBuffer[id] = v; +}
\ No newline at end of file diff --git a/tests/diagnostics/syntax-error-op-line-3.slang.expected b/tests/diagnostics/syntax-error-op-line-3.slang.expected new file mode 100644 index 000000000..e522732c7 --- /dev/null +++ b/tests/diagnostics/syntax-error-op-line-3.slang.expected @@ -0,0 +1 @@ +38 |
