diff options
| author | Yong He <yonghe@outlook.com> | 2024-11-02 20:35:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-02 20:35:22 -0700 |
| commit | f4d5aa73fb72a483f04bb6b014e80192331504ea (patch) | |
| tree | 6b3143b85f05ccba735beb7b98531104e8445053 /tests/language-feature | |
| parent | 61cddbee405935fa8391a757a08bcbe4ea7ac98f (diff) | |
Revert uint<->int implicit cast cost to prefer promotion to unsigned. (#5480)
Diffstat (limited to 'tests/language-feature')
| -rw-r--r-- | tests/language-feature/overload-resolution-signed-unsigned.slang | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/language-feature/overload-resolution-signed-unsigned.slang b/tests/language-feature/overload-resolution-signed-unsigned.slang new file mode 100644 index 000000000..f8de85810 --- /dev/null +++ b/tests/language-feature/overload-resolution-signed-unsigned.slang @@ -0,0 +1,20 @@ +//TEST:SIMPLE(filecheck=CHECK): -target hlsl -stage compute -entry main +RWStructuredBuffer<float> result; +// CHECK-NOT: result{{.*}}[int(0)] = 1 +// CHECK: result{{.*}}[int(0)] = 2 +// CHECK-NOT: result{{.*}}[int(0)] = 1 +[numthreads(1,1,1)] +void main() +{ + int ic = -1; + uint a = 2; + if (ic < a) + { + result[0] = 1; + } + else + { + // Should pick this branch according to C spec. + result[0] = 2; + } +}
\ No newline at end of file |
