forked from microsoft/DirectXShaderCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sema: fix int enum implicit cast to float.
An implicit cast from int enum to a float should be a Floating_Integral cast, not an Integral_Conversion. Fixes microsoft#6884 Signed-off-by: Nathan Gauër <[email protected]>
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: %dxc -T cs_6_6 -fspv-target-env=vulkan1.3 -E main %s -spirv -fcgl | FileCheck %s | ||
|
||
enum : uint { | ||
UA = 1 | ||
}; | ||
|
||
enum : int { | ||
SA = 3 | ||
}; | ||
|
||
static float p; | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() { | ||
//CHECK: OpStore %foo %float_1 | ||
float foo = UA; | ||
|
||
//CHECK: OpStore %bar %float_3 | ||
float bar = SA; | ||
} |
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