[llvm-branch-commits] [llvm] [Dexter] Enable after_hit_count for state nodes (PR #203846)

Orlando Cazalet-Hyams via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jun 30 04:15:45 PDT 2026


================
@@ -0,0 +1,38 @@
+// RUN: %dexter_regression_test_cxx_build %s -o %t
+// RUN: %dexter_regression_test_run --use-script --binary %t -- %s \
+// RUN:   | FileCheck %s
+
+/// Test that Dexter respects for and after hit_counts.
+
+void receive(int N) {}
+
+int main() {
+  int Current = 0;
+  int Increment = 1;
+  for (int I = 0; I < 10; ++I) {
+    receive(Current); // !dex_label loop
+    Current += Increment++;
+  }
+  return 0;
+}
+
+// CHECK: total_watched_steps: 10
+// CHECK: correct_steps: 10
+// CHECK: incorrect_steps: 0
+// CHECK: partial_step_correctness: 10.0
+// CHECK: missing_var_steps: 0
+// CHECK: unexpected_value_steps: 0
+// CHECK: correct_step_coverage: 100.0% (10/10)
+// CHECK: seen_values: 10
+// CHECK: missing_values: 0
+
+/*
+---
+!where {function: receive, after_hit_count: 3, for_hit_count: 4}:
----------------
OCHyams wrote:

Just to be clear, am I right that you can only say `always`, `after n then always`, `for n`, and `after n then for m` but not `for n then after m then always`? if so it's fine, that feels a bit obscure, but imo how these compose should be documented. If you can actually do the latter then we should have a test for that too

https://github.com/llvm/llvm-project/pull/203846


More information about the llvm-branch-commits mailing list