diff options
| author | Yong He <yhe@nvidia.com> | 2020-06-04 12:42:17 -0700 |
|---|---|---|
| committer | Yong He <yhe@nvidia.com> | 2020-06-04 12:42:17 -0700 |
| commit | 4e2f2771eb2f8991014d957848a6a25aa49c0aaf (patch) | |
| tree | 5d80cc746b1b83ca9feb46cbaab51012506243cf /tests/cross-compile/loop-attribs.slang | |
| parent | 1b8731c809761c4e2dbec81dcee207f8a4621903 (diff) | |
Emit [loop] attribute to output HLSL.
Diffstat (limited to 'tests/cross-compile/loop-attribs.slang')
| -rw-r--r-- | tests/cross-compile/loop-attribs.slang | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/cross-compile/loop-attribs.slang b/tests/cross-compile/loop-attribs.slang new file mode 100644 index 000000000..ddedb67df --- /dev/null +++ b/tests/cross-compile/loop-attribs.slang @@ -0,0 +1,19 @@ +// loop-attribs.slang +// Test that loop attributes are correctly emitted to the resulting HLSL. + +//TEST:SIMPLE:-target hlsl -entry main -stage fragment -profile sm_6_0 + +float4 main() : SV_Target +{ + float sum = 0.0f; + + [loop] + for (int i = 0; i < 100; i++) + sum += float(i); + + [unroll(10)] + for (int j = 0; j < 100; j++) + sum += float(j); + + return float4(sum, 0, 0, 0); +}
\ No newline at end of file |
