diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-04-16 22:01:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-16 19:01:06 -0700 |
| commit | 282da4ac94d60d3244f4d72085e66fb82cf5abd8 (patch) | |
| tree | d4c2b7d952ffbcb3f3e6debe6648bedb38b0fc66 /tests | |
| parent | d5d39dda2ec02c1dd21ba34a89f74b27092efcdd (diff) | |
Fix for unscoped enums circular reference causing an error, #3959 (#3962)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/language-feature/enums/unscoped-enum-explicit-type.slang | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/language-feature/enums/unscoped-enum-explicit-type.slang b/tests/language-feature/enums/unscoped-enum-explicit-type.slang new file mode 100644 index 000000000..aefbf8449 --- /dev/null +++ b/tests/language-feature/enums/unscoped-enum-explicit-type.slang @@ -0,0 +1,32 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj + +//TEST_INPUT:ubuffer(data=[0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<uint32_t> outputBuffer; + +[UnscopedEnum] +enum unscopedEnum : uint32_t +{ + kEnumVal1 = 5, + kEnumVal2 = 6, +}; + +struct structWithEnumVal +{ + unscopedEnum val; +}; + +void takeInToWriteFruit(unscopedEnum inData, structWithEnumVal inData2) +{ + outputBuffer[0] = inData; + outputBuffer[1] = inData2.val; +} + +[numthreads(1,1,1)] +void computeMain() +{ + // CHECK: 5 + // CHECK: 6 + structWithEnumVal enumVal; + enumVal.val = kEnumVal2; + takeInToWriteFruit(kEnumVal1, enumVal); +}
\ No newline at end of file |
