Verify that constant values are the correct size

Since we now allow constants of any size, we have to verify that `vconst` (currently the only user of the constant pool) is accessing constants that match its controlling type.
This commit is contained in:
Andrew Brown
2020-03-20 14:10:04 -07:00
parent 0672d1dc0f
commit fa35d88878
2 changed files with 41 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
test verifier
set enable_simd
function %incorrect_constant_size() {
const13 = [1 2 3 4 5] ; this constant has 5 bytes
block0:
v0 = vconst.i32x4 const13 ; error: The instruction expects const13 to have a size of 16 bytes but it has 5
return
}