summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-05-24 12:41:02 +0000
committerClement Courbet <courbet@google.com>2018-05-24 12:41:02 +0000
commitae8ae5dc78b8c6950b57b37706dfc37131d4d913 (patch)
treeb2db1517539526a5e3653bc38c881607eb1eaa0f /llvm/unittests/tools
parent13f8a77d79ed48da17ee61e0ba1357418ad2d706 (diff)
downloadbcm5719-llvm-ae8ae5dc78b8c6950b57b37706dfc37131d4d913.tar.gz
bcm5719-llvm-ae8ae5dc78b8c6950b57b37706dfc37131d4d913.zip
[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
Diffstat (limited to 'llvm/unittests/tools')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
index 9e00510c7c0..33b139c88a2 100644
--- a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
@@ -77,5 +77,15 @@ TEST(BenchmarkResultTest, WriteToAndReadFromDisk) {
}
}
+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
OpenPOWER on IntegriCloud