Add validation coverage for const SHIFT override (#4649)

Test that we correctly reject excessive shift amounts when the LHS is
constant and the RHS is an override.

Missing coverage as per a recent Tint bug.
This commit is contained in:
James Price 2026-05-28 20:52:45 -04:00 committed by GitHub
parent 16f8a068db
commit b507bd117e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -303,6 +303,7 @@ g.test('partial_eval_errors')
u
.combine('op', ['<<', '>>'] as const)
.combine('type', ['i32', 'u32'] as const)
.combine('lhs', ['const', 'var'] as const)
.combine('vectorize', [undefined, 2, 3, 4] as const)
.beginSubcases()
.combine('stage', ['shader', 'pipeline'] as const)
@ -320,7 +321,7 @@ g.test('partial_eval_errors')
const wgsl = `
override o = 0u;
fn foo() -> ${vecType} {
var v : ${vecType} = ${vectorize('0', vec_size)};
${t.params.lhs} v : ${vecType} = ${vectorize('0', vec_size)};
return v ${t.params.op} ${vectorize(rhs, vec_size)};
}`;