[llvm-exegesis] Analysis: Show value extents.
Summary: Screenshot attached in phabricator.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D47318
llvm-svn: 333181
diff --git a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
index 9e00510..33b139c 100644
--- a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
@@ -77,5 +77,15 @@
}
}
+TEST(BenchmarkResultTest, BenchmarkMeasureStats) {
+ BenchmarkMeasureStats Stats;
+ Stats.push(BenchmarkMeasure{"a", 0.5, "debug a"});
+ Stats.push(BenchmarkMeasure{"a", 1.5, "debug a"});
+ Stats.push(BenchmarkMeasure{"a", -1.0, "debug a"});
+ Stats.push(BenchmarkMeasure{"a", 0.0, "debug a"});
+ EXPECT_EQ(Stats.min(), -1.0);
+ EXPECT_EQ(Stats.max(), 1.5);
+ EXPECT_EQ(Stats.avg(), 0.25); // (0.5+1.5-1.0+0.0) / 4
+}
} // namespace
} // namespace exegesis