-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
e771f19
commit d3ad6bb
Showing
7 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/language-feature/enums/unscoped-enum-explicit-type-2.slang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|