[llvm-branch-commits] [llvm] [Dexter] Add label nodes for line references (PR #202544)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jun 9 02:01:59 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/Inputs/header.h cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/invalid_label.cpp cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/offset.cpp cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/simple_labels.cpp cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/source_root_dir.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/Inputs/header.h b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/Inputs/header.h
index 353053eb1..47d7346e3 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/Inputs/header.h
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/Inputs/header.h
@@ -1,8 +1,8 @@
int multiply(int a, int b) {
- int result = 0;
- for (int i = 0; i < b; ++i) {
- result += a;
- }
- return result; // !dex_label mul
+ int result = 0;
+ for (int i = 0; i < b; ++i) {
+ result += a;
+ }
+ return result; // !dex_label mul
}
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/invalid_label.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/invalid_label.cpp
index 54418d085..9da5fcb60 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/invalid_label.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/invalid_label.cpp
@@ -1,10 +1,11 @@
// RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_regression_test_run --source-root-dir %S/Inputs --use-script --binary %t -- %s 2>&1 | FileCheck %s
+// RUN: not %dexter_regression_test_run --source-root-dir %S/Inputs --use-script
+// --binary %t -- %s 2>&1 | FileCheck %s
int main() {
- int a = 4;
- int b = 4;
- return b - a; // !dex_label unused
+ int a = 4;
+ int b = 4;
+ return b - a; // !dex_label unused
}
// CHECK: error: Error with node: Label(used): Label "used" not found
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/offset.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/offset.cpp
index 5c0bb7b99..855b26abc 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/offset.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/offset.cpp
@@ -1,14 +1,14 @@
// RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: %dexter_regression_test_run --use-script --binary %t -- %s | FileCheck %s
-
+// RUN: %dexter_regression_test_run --use-script --binary %t -- %s | FileCheck
+// %s
int main() {
- int count = 0;
- ++count; // !dex_label start
- ++count;
- ++count;
- ++count;
- return count;
+ int count = 0;
+ ++count; // !dex_label start
+ ++count;
+ ++count;
+ ++count;
+ return count;
} // !dex_label end
// CHECK: total_watched_steps: 5
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/simple_labels.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/simple_labels.cpp
index c65a9c8fc..161b9835e 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/simple_labels.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/simple_labels.cpp
@@ -1,20 +1,21 @@
// RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: %dexter_regression_test_run --use-script --binary %t -- %s | FileCheck %s
+// RUN: %dexter_regression_test_run --use-script --binary %t -- %s | FileCheck
+// %s
#include "Inputs/header.h"
int factorial(int n) {
- int result = 1;
- // !dex_label factorial_start
- for (int i = 1; i <= n; ++i) {
- result = multiply(result, i);
- }
- return result; // !dex_label factorial_end
+ int result = 1;
+ // !dex_label factorial_start
+ for (int i = 1; i <= n; ++i) {
+ result = multiply(result, i);
+ }
+ return result; // !dex_label factorial_end
}
int main() {
- int a = 4;
- return factorial(a); // !dex_label call
+ int a = 4;
+ return factorial(a); // !dex_label call
}
// CHECK: total_watched_steps: 20
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/source_root_dir.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/source_root_dir.cpp
index 420d1b6b4..2efa93d75 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/source_root_dir.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/labels/source_root_dir.cpp
@@ -1,5 +1,6 @@
// RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: %dexter_regression_test_run --source-root-dir %S/Inputs --use-script --binary %t -- %s | FileCheck %s
+// RUN: %dexter_regression_test_run --source-root-dir %S/Inputs --use-script
+// --binary %t -- %s | FileCheck %s
// Check that when --source-root-dir is provided, labels will be checked
// relative to that directory.
@@ -7,17 +8,17 @@
#include "Inputs/header.h"
int factorial(int n) {
- int result = 1;
- // !dex_label factorial_start
- for (int i = 1; i <= n; ++i) {
- result = multiply(result, i);
- }
- return result; // !dex_label factorial_end
+ int result = 1;
+ // !dex_label factorial_start
+ for (int i = 1; i <= n; ++i) {
+ result = multiply(result, i);
+ }
+ return result; // !dex_label factorial_end
}
int main() {
- int a = 4;
- return factorial(a); // !dex_label call
+ int a = 4;
+ return factorial(a); // !dex_label call
}
// CHECK: total_watched_steps: 20
``````````
</details>
https://github.com/llvm/llvm-project/pull/202544
More information about the llvm-branch-commits
mailing list