[llvm] aaa59e3 - [gn] port 29fef3a51e6d (bolt PassTests)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 06:05:45 PST 2025


Author: Nico Weber
Date: 2025-12-01T09:05:38-05:00
New Revision: aaa59e34894d3d0648631776afe2b297e2ad0895

URL: https://github.com/llvm/llvm-project/commit/aaa59e34894d3d0648631776afe2b297e2ad0895
DIFF: https://github.com/llvm/llvm-project/commit/aaa59e34894d3d0648631776afe2b297e2ad0895.diff

LOG: [gn] port 29fef3a51e6d (bolt PassTests)

Added: 
    llvm/utils/gn/secondary/bolt/unittests/Passes/BUILD.gn

Modified: 
    llvm/utils/gn/secondary/bolt/unittests/BUILD.gn
    llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/bolt/unittests/BUILD.gn b/llvm/utils/gn/secondary/bolt/unittests/BUILD.gn
index 9c5be5966b3fc..eded7696e9e8b 100644
--- a/llvm/utils/gn/secondary/bolt/unittests/BUILD.gn
+++ b/llvm/utils/gn/secondary/bolt/unittests/BUILD.gn
@@ -2,6 +2,7 @@ group("unittests") {
   deps = [
     "Core:CoreTests",
     "Profile:ProfileTests",
+    "Passes:PassTests",
   ]
   testonly = true
 }

diff  --git a/llvm/utils/gn/secondary/bolt/unittests/Passes/BUILD.gn b/llvm/utils/gn/secondary/bolt/unittests/Passes/BUILD.gn
new file mode 100644
index 0000000000000..9b2abd4eb71d8
--- /dev/null
+++ b/llvm/utils/gn/secondary/bolt/unittests/Passes/BUILD.gn
@@ -0,0 +1,48 @@
+import("//llvm/lib/Target/targets.gni")
+import("//third-party/unittest/unittest.gni")
+
+unittest("PassTests") {
+  configs += [ "//llvm/utils/gn/build:bolt_code" ]
+  deps = [
+    "//bolt/include/bolt/Core:TargetConfig.def",
+    "//bolt/lib/Core",
+    "//bolt/lib/Passes",
+    "//bolt/lib/Profile",
+    "//bolt/lib/Rewrite",
+    "//bolt/lib/Utils",
+    "//llvm/lib/DebugInfo/DWARF",
+    "//llvm/lib/MC",
+    "//llvm/lib/Object",
+    "//llvm/lib/Target:TargetsToBuild",
+  ]
+  sources = [ "InsertNegateRAState.cpp" ]
+
+  defines = []
+  include_dirs = []
+  if (llvm_build_AArch64) {
+    defines += [ "AARCH64_AVAILABLE" ]
+
+    # This target reaches into the internal headers of LLVM's AArch64 library.
+    # That target doesn't expect that, so it doesn't use public_deps for
+    # tblgen-generated headers used only in internal headers (...which this
+    # target here questionably includes). So depend on the target that generates
+    # those headers here.
+    include_dirs += [ "//llvm/lib/Target/AArch64" ]
+    deps += [
+      "//llvm/lib/Target/AArch64:AArch64GenSDNodeInfo",
+      "//llvm/lib/Target/AArch64/MCTargetDesc",
+      "//llvm/lib/Target/AArch64/Utils",
+    ]
+  }
+  if (llvm_build_X86) {
+    defines += [ "X86_AVAILABLE" ]
+
+    # This target reaches into the internal headers of LLVM's X86 library.
+    # That target doesn't expect that, so it doesn't use public_deps for
+    # tblgen-generated headers used only in internal headers (...which this
+    # target here questionably includes). So depend on the target that generates
+    # those headers here.
+    include_dirs += [ "//llvm/lib/Target/X86" ]
+    deps += [ "//llvm/lib/Target/X86/MCTargetDesc" ]
+  }
+}

diff  --git a/llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn
index 4319bd92d163e..52601f108a059 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn
@@ -76,6 +76,7 @@ tablegen("AArch64GenSDNodeInfo") {
   visibility = [
     ":LLVMAArch64CodeGen",
     "//bolt/unittests/Core:CoreTests",
+    "//bolt/unittests/Passes:PassTests",
     "//llvm/unittests/Target/AArch64:AArch64Tests",
   ]
   args = [ "-gen-sd-node-info" ]


        


More information about the llvm-commits mailing list