diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-14 14:45:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-14 14:45:57 -0700 |
| commit | f5f0740be8102b4d719575d97b00dbd21b54ffbe (patch) | |
| tree | 3ca8da03f4ff12a11a42370d17bcd9593a103cfd /tests | |
| parent | 78d4df0644b20b8ba4eeff459c749c4e8d261345 (diff) | |
Support unscoped enums. (#3771)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/language-feature/enums/unscoped-enum.slang | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/language-feature/enums/unscoped-enum.slang b/tests/language-feature/enums/unscoped-enum.slang new file mode 100644 index 000000000..6d6558268 --- /dev/null +++ b/tests/language-feature/enums/unscoped-enum.slang @@ -0,0 +1,17 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj + +[UnscopedEnum] +enum class Fruit +{ + Orange, Apple +} + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<uint> outputBuffer; + +[numthreads(1,1,1)] +void computeMain() +{ + // CHECK: 1 + outputBuffer[0] = (int)Apple; +}
\ No newline at end of file |
