-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nathan Gauër <[email protected]>
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
tools/clang/test/CodeGenDXIL/hlsl/types/type-enum-cast.hlsl
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,31 @@ | ||
// RUN: %dxc -T vs_6_5 %s | FileCheck %s | ||
|
||
enum UE : uint { | ||
UA = 1 | ||
}; | ||
|
||
enum SE : int { | ||
SA = 3 | ||
}; | ||
|
||
struct Output { | ||
float u; | ||
float s; | ||
}; | ||
|
||
Output main(UE u : A, SE s : B) : C { | ||
// CHECK-DAG: %[[U:.+]] = call i32 @dx.op.loadInput.i32(i32 4, i32 0, i32 0, i8 0, i32 undef) | ||
// CHECK-DAG: %[[S:.+]] = call i32 @dx.op.loadInput.i32(i32 4, i32 1, i32 0, i8 0, i32 undef) | ||
|
||
Output o; | ||
|
||
o.u = u; | ||
// CHECK-DAG: %[[FU:.+]] = uitofp i32 %[[U]] to float | ||
// CHECK-DAG: call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, float %[[FU]]) | ||
|
||
o.s = s; | ||
// CHECK-DAG: %[[FS:.+]] = sitofp i32 %[[S]] to float | ||
// CHECK-DAG: call void @dx.op.storeOutput.f32(i32 5, i32 1, i32 0, i8 0, float %[[FS]]) | ||
|
||
return o; | ||
} |