Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 1, 2022
1 parent d854d3b commit 4b42814
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/cpp/ir/type_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ TEST(Type, TypeToString) {
auto qfl = TypeFactory::get_instance().get_quant_float_type(qi5, qu7, f32);

auto bs1 = TypeFactory::get_instance().get_bit_struct_type(
/*physical_type=*/u16, /*member_types=*/{qi5, qu7}, /*member_bit_offsets=*/{0, 5}, /*member_exponents=*/{-1, -1}, /*member_exponent_users=*/{{}, {}});
/*physical_type=*/u16, /*member_types=*/{qi5, qu7},
/*member_bit_offsets=*/{0, 5}, /*member_exponents=*/{-1, -1},
/*member_exponent_users=*/{{}, {}});
EXPECT_EQ(bs1->to_string(), "bs(0: qi5@0, 1: qu7@5)");

auto bs2 = TypeFactory::get_instance().get_bit_struct_type(
/*physical_type=*/u32, /*member_types=*/{qu7, qfl, qu7, qfl}, /*member_bit_offsets=*/{0, 7, 12, 19}, /*member_exponents=*/{-1, 0, -1, 2},
/*physical_type=*/u32, /*member_types=*/{qu7, qfl, qu7, qfl},
/*member_bit_offsets=*/{0, 7, 12, 19},
/*member_exponents=*/{-1, 0, -1, 2},
/*member_exponent_users=*/{{1}, {}, {3}, {}});
EXPECT_EQ(bs2->to_string(),
"bs(0: qu7@0, 1: qfl(d=qi5 e=qu7 c=f32)@7 exp=0, 2: qu7@12, 3: "
"qfl(d=qi5 e=qu7 c=f32)@19 exp=2)");

auto bs3 = TypeFactory::get_instance().get_bit_struct_type(
/*physical_type=*/u32, /*member_types=*/{qu7, qfl, qfl}, /*member_bit_offsets=*/{0, 7, 12}, /*member_exponents=*/{-1, 0, 0}, /*member_exponent_users=*/{{1, 2}, {}, {}});
/*physical_type=*/u32, /*member_types=*/{qu7, qfl, qfl},
/*member_bit_offsets=*/{0, 7, 12}, /*member_exponents=*/{-1, 0, 0},
/*member_exponent_users=*/{{1, 2}, {}, {}});
EXPECT_EQ(bs3->to_string(),
"bs(0: qu7@0, 1: qfl(d=qi5 e=qu7 c=f32)@7 shared_exp=0, 2: "
"qfl(d=qi5 e=qu7 c=f32)@12 shared_exp=0)");
Expand Down

0 comments on commit 4b42814

Please sign in to comment.