diff options
| author | Julius Ikkala <julius.ikkala@gmail.com> | 2025-01-17 03:06:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-17 01:06:00 +0000 |
| commit | d3ad6bb4997d3b7ba2dc9653a2d5f7dc965b150f (patch) | |
| tree | 4726f721cec95ec5ea2ec8408a081ca93338e923 /tests/language-feature | |
| parent | e771f1945ed692168a2634d66a0907acc9c68858 (diff) | |
Fix cyclic lookups with UnscopedEnums (#6110)
* Fix cyclic lookups with UnscopedEnums
* Add test with multiple unscoped enums with explicit types
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/language-feature')
| -rw-r--r-- | tests/language-feature/enums/unscoped-enum-explicit-type-2.slang | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/language-feature/enums/unscoped-enum-explicit-type-2.slang b/tests/language-feature/enums/unscoped-enum-explicit-type-2.slang new file mode 100644 index 000000000..1c74dd7b7 --- /dev/null +++ b/tests/language-feature/enums/unscoped-enum-explicit-type-2.slang @@ -0,0 +1,33 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -shaderobj + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<uint32_t> outputBuffer; + +[UnscopedEnum] +enum unscopedEnum1 : uint32_t +{ + ENUM1_A = 1, + ENUM1_B = 2 +}; + +[UnscopedEnum] +enum unscopedEnum2 : uint32_t +{ + ENUM2_A = 3, + ENUM2_B = 4 +}; + +[numthreads(1,1,1)] +void computeMain() +{ + // CHECK: 1 + // CHECK: 2 + // CHECK: 3 + // CHECK: 4 + outputBuffer[0] = ENUM1_A; + outputBuffer[1] = ENUM1_B; + outputBuffer[2] = ENUM2_A; + outputBuffer[3] = ENUM2_B; +} + |
