diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-09 04:47:16 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-09 20:47:16 +0800 |
| commit | 525412c67ceea9f52a26e42044e99b349ebc2535 (patch) | |
| tree | 77523cefc75d605fc69aa5bf498bcf18656c34c3 /tests/diagnostics/nested-func.slang | |
| parent | 2bec21e91164c8533e93540dc8b610fb24205b7e (diff) | |
Report error on nested functions. (#5792)
* Report error on nested functions.
* Fix.
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests/diagnostics/nested-func.slang')
| -rw-r--r-- | tests/diagnostics/nested-func.slang | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/diagnostics/nested-func.slang b/tests/diagnostics/nested-func.slang new file mode 100644 index 000000000..42634cb8a --- /dev/null +++ b/tests/diagnostics/nested-func.slang @@ -0,0 +1,12 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + + +struct VertexOutput{float Input;} +float4 fragmentMain(VertexOutput vertex) : SV_Target +{ + // CHECK: ([[# @LINE+1]]): error 30102 + static float GetValue(int val) { return vertex.Input; } // Simplified example + float a = GetValue(vertex.Input); + + // etc +} |
