[llvm-branch-commits] [llvm] [Dexter] Add !address node (PR #202801)

Stephen Tozer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jun 24 03:51:42 PDT 2026


================
@@ -0,0 +1,66 @@
+// RUN: %dexter_regression_test_cxx_build %s -o %t
+// RUN: %dexter_regression_test_run --use-script --binary %t -- %s \
+// RUN:   | FileCheck %s
+
+// Test evaluation of !address nodes in Dexter.
+
+// CHECK:      Non-matching nodes:
+// CHECK-SAME: Value(FalseStart)
+// CHECK:      Non-matching nodes:
+// CHECK-SAME: Value(EvenFalserStart)
+// CHECK-NOT: Non-matching nodes
+
+// CHECK: total_watched_steps: 12
+// CHECK: correct_steps: 10
+// CHECK: incorrect_steps: 2
+// CHECK: missing_var_steps: 0
+// CHECK: unexpected_value_steps: 2
+// CHECK: seen_values: 11
+// CHECK: missing_values: 2
+
+struct SubRange {
+  char *Begin;
+  int Length;
+};
+
+int main() {
+  char Data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+  char *Start = Data;
+  char *FalseStart = Data + 1;
+  char *EvenFalserStart = Data + 2;
+  char *Middle = Data + 5; // !dex_label begin
+  char *NearEnd = Data + 8;
+  char *Pos = Data + 4;
+  for (int I = 0; I < 6; ++I) {
+    Pos = Pos + 1; // !dex_label loop
+  }
+  SubRange Range = {Data + 2, 4};
+  return 0; // !dex_label ret
+}
+
+/*
+---
+# `Start` will be correct and `FalseStart` will be incorrect, because `Start` is
+# evaluated first.
+!where {lines: !label begin}:
+    !value Start: !address data
+    !value FalseStart: !address data
+# `EvenFalserStart` will also be incorrect, because it has been evaluated later.
+!where {lines: !label begin + 1}:
+    !value EvenFalserStart: !address data
----------------
SLTozer wrote:

Different variable names/address names can all evaluate to the same address - the incorrect values here are that they all have different addresses but the same address label, i.e. we're expecting that they all have the same address when they all have different addresses.

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


More information about the llvm-branch-commits mailing list