MCPcopy Create free account
hub / github.com/apache/impala / TEST_F

Function TEST_F

be/src/codegen/instruction-counter-test.cc:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73TEST_F(InstructionCounterTest, Count) {
74 llvm::Module* MulAddModule = CodegenMulAdd(&context_);
75 InstructionCounter instruction_counter;
76 instruction_counter.visit(*MulAddModule);
77 instruction_counter.PrintCounters();
78 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::TOTAL_FUNCTIONS), 1);
79 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::TOTAL_INSTS), 3);
80 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::TERMINATOR_INSTS), 1);
81 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::MEMORY_INSTS), 0);
82
83 // Test Reset
84 instruction_counter.ResetCount();
85 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::TOTAL_FUNCTIONS), 0);
86 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::TOTAL_INSTS), 0);
87 EXPECT_EQ(instruction_counter.GetCount(InstructionCounter::MEMORY_INSTS), 0);
88}
89
90// IR output from CodegenGcd
91// define i32 @gcd(i32 %x, i32 %y) {

Callers

nothing calls this directly

Calls 6

CodegenMulAddFunction · 0.85
CodegenGcdFunction · 0.85
PrintCountersMethod · 0.80
GetCountMethod · 0.80
visitMethod · 0.65
ResetCountMethod · 0.45

Tested by

no test coverage detected