Skip to content

Commit 5fd6835

Browse files
committed
Add pending test
1 parent a5cf52c commit 5fd6835

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/tests_profiler.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,18 @@ DEFINE_TEST(test_perf_hardware_multi) {
359359
}
360360
}
361361

362+
// INSTRUMENT_PERF: identical counter combination at two call sites — must reuse
363+
// the same group FD without error.
364+
DEFINE_TEST(test_perf_identical_groups) {
365+
INSTRUMENT_FUNCTION();
366+
INSTRUMENT_PERF("task-clock", "page-faults");
367+
std::vector<size_t> v(1000);
368+
std::iota(v.begin(), v.end(), 0);
369+
size_t sum = std::accumulate(v.begin(), v.end(), size_t{0});
370+
(void)sum;
371+
INSTRUMENT_PERF("task-clock", "page-faults");
372+
}
373+
362374
// INSTRUMENT_PERF: two groups sharing a counter name — must throw profilerError
363375
// on the second group's first use, because the same counter in two groups would
364376
// produce independent FDs with different reset points, making values incomparable.

0 commit comments

Comments
 (0)