@@ -200,7 +200,7 @@ void table_section_tests() {
expect_eq(module.table_section,
wasm::TableSection{.tables{
wasm::TableType{
wasm::ValueType{wasm::ValueType::FunctionReference},
wasm::ValueType::FunctionReference,
wasm::Limits{.min = 42},
},
}});
@@ -217,7 +217,7 @@ void table_section_tests() {
expect_eq(module.table_section,
wasm::TableSection{.tables{
wasm::TableType{
wasm::ValueType{wasm::ValueType::ExternReference},
wasm::ValueType::ExternReference,
wasm::Limits{.min = 42, .max = 42},
},
}});
@@ -323,7 +323,7 @@ void global_section_tests() {
.value();
expect_eq(module.global_section,
wasm::GlobalSection{.globals{{
.type{wasm::ValueType{wasm::ValueType::Int32}, wasm::GlobalType::Mutability::Const},
.type{wasm::ValueType::Int32, wasm::GlobalType::Mutability::Const},
.init{wasm::instructions::I32Const{42}},
}}});
});
@@ -333,7 +333,7 @@ void global_section_tests() {
.value();
expect_eq(module.global_section,
wasm::GlobalSection{.globals{{
.type{wasm::ValueType{wasm::ValueType::Int32}, wasm::GlobalType::Mutability::Var},
.type{wasm::ValueType::Int32, wasm::GlobalType::Mutability::Var},
.init{wasm::instructions::I32Const{42}},
}}});
});
@@ -345,11 +345,11 @@ void global_section_tests() {
expect_eq(module.global_section,
wasm::GlobalSection{.globals{
{
.type{wasm::ValueType{wasm::ValueType::Int32}, wasm::GlobalType::Mutability::Var},
.type{wasm::ValueType::Int32, wasm::GlobalType::Mutability::Var},
.init{wasm::instructions::I32Const{42}},
},
{
.type{wasm::ValueType{wasm::ValueType::Int32}, wasm::GlobalType::Mutability::Const},
.type{wasm::ValueType::Int32, wasm::GlobalType::Mutability::Const},
.init{wasm::instructions::I32Const{42}},
},
}});
@@ -403,11 +403,10 @@ void type_section_tests() {
expect_eq(module.type_section,
wasm::TypeSection{
.types{
wasm::FunctionType{.results{wasm::ValueType{wasm::ValueType::Int32}}},
wasm::FunctionType{.results{wasm::ValueType::Int32}},
wasm::FunctionType{
.parameters{wasm::ValueType{wasm::ValueType::Int32},
wasm::ValueType{wasm::ValueType::Int32}},
.results{wasm::ValueType{wasm::ValueType::Float64}},
.parameters{wasm::ValueType::Int32, wasm::ValueType::Int32},
.results{wasm::ValueType::Float64},
},
},
});
@@ -423,13 +422,13 @@ void type_section_tests() {
.types{
wasm::FunctionType{
.parameters{
wasm::ValueType{wasm::ValueType::Int32},
wasm::ValueType{wasm::ValueType::Int64},
wasm::ValueType{wasm::ValueType::Float32},
wasm::ValueType{wasm::ValueType::Float64},
wasm::ValueType{wasm::ValueType::Vector128},
wasm::ValueType{wasm::ValueType::FunctionReference},
wasm::ValueType{wasm::ValueType::ExternReference},
wasm::ValueType::Int32,
wasm::ValueType::Int64,
wasm::ValueType::Float32,
wasm::ValueType::Float64,
wasm::ValueType::Vector128,
wasm::ValueType::FunctionReference,
wasm::ValueType::ExternReference,
},
},
},
@@ -481,7 +480,7 @@ void code_section_tests() {
wasm::CodeSection expected{.entries{
wasm::CodeEntry{
.code{wasm::instructions::I32Const{0b11}, wasm::instructions::I32PopulationCount{}},
.locals{{1, wasm::ValueType{wasm::ValueType::Int32}}},
.locals{{1, wasm::ValueType::Int32}},
},
}};
expect_eq(module.code_section, expected);
@@ -495,12 +494,11 @@ void code_section_tests() {
wasm::CodeSection expected{.entries{
wasm::CodeEntry{
.code{wasm::instructions::I32Const{42}},
.locals{{1, wasm::ValueType{wasm::ValueType::Int32}}},
.locals{{1, wasm::ValueType::Int32}},
},
wasm::CodeEntry{
.code{},
.locals{{5, wasm::ValueType{wasm::ValueType::Int64}},
{6, wasm::ValueType{wasm::ValueType::Float32}}},
.locals{{5, wasm::ValueType::Int64}, {6, wasm::ValueType::Float32}},
},
}};
expect_eq(module.code_section, expected);