[compiler-rt] [MemProf][compiler-rt] Add a test to ensure include files do not diverge (PR #97775)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 16:59:56 PDT 2024


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/97775

>From a2abe5e322d61f9ac807d6fdd4c95b414434ecea Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 4 Jul 2024 23:46:58 +0000
Subject: [PATCH 1/2] [MemProf][compiler-rt] Add a test to ensure include files
 do not diverge

Memprof has two include files that are duplicated between LLVM and
compiler-rt. They need to stay in sync to ensure correct functionality,
but the comments can be somewhat easy to miss, which causes fixups like
839ed1ba553346b0c225e9b839cf3cb716dc7412 to be needed. This patch adds a
test to ensure that the files are the same between LLVM and compiler-rt
to catch this ideally before commit, but if not, soon afterwards.
---
 compiler-rt/test/profile/check-same-common-code.test | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 compiler-rt/test/profile/check-same-common-code.test

diff --git a/compiler-rt/test/profile/check-same-common-code.test b/compiler-rt/test/profile/check-same-common-code.test
new file mode 100644
index 0000000000000..5cede37fe06c2
--- /dev/null
+++ b/compiler-rt/test/profile/check-same-common-code.test
@@ -0,0 +1,6 @@
+;
+; NOTE: if this test fails, please make sure the relevant copies are identical
+; copies of each other.
+;
+; RUN: diff %crt_src/include/profile/MIBEntryDef.inc %llvm_src/include/llvm/ProfileData/MIBEntryDef.inc
+; RUN: diff %crt_src/include/profile/MemProfData.inc %llvm_src/include/llvm/ProfileData/MemProfData.inc

>From 2ef989d698eabb3409216ccfe4cbcda1979fb929 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 4 Jul 2024 23:59:42 +0000
Subject: [PATCH 2/2] Add InstrProfData.inc

---
 compiler-rt/test/profile/check-same-common-code.test | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/test/profile/check-same-common-code.test b/compiler-rt/test/profile/check-same-common-code.test
index 5cede37fe06c2..81896ea482973 100644
--- a/compiler-rt/test/profile/check-same-common-code.test
+++ b/compiler-rt/test/profile/check-same-common-code.test
@@ -4,3 +4,4 @@
 ;
 ; RUN: diff %crt_src/include/profile/MIBEntryDef.inc %llvm_src/include/llvm/ProfileData/MIBEntryDef.inc
 ; RUN: diff %crt_src/include/profile/MemProfData.inc %llvm_src/include/llvm/ProfileData/MemProfData.inc
+; RUN: diff %crt_src/include/profile/InstrProfData.inc %llvm_src/include/llvm/ProfileData/InstrProfData.inc



More information about the llvm-commits mailing list