Skip to content

Commit 19448cd

Browse files
nicoHoney Goyal
authored andcommitted
[gn] port 29fef3a (bolt PassTests)
1 parent 7c7c99d commit 19448cd

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

llvm/utils/gn/secondary/bolt/unittests/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ group("unittests") {
22
deps = [
33
"Core:CoreTests",
44
"Profile:ProfileTests",
5+
"Passes:PassTests",
56
]
67
testonly = true
78
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import("//llvm/lib/Target/targets.gni")
2+
import("//third-party/unittest/unittest.gni")
3+
4+
unittest("PassTests") {
5+
configs += [ "//llvm/utils/gn/build:bolt_code" ]
6+
deps = [
7+
"//bolt/include/bolt/Core:TargetConfig.def",
8+
"//bolt/lib/Core",
9+
"//bolt/lib/Passes",
10+
"//bolt/lib/Profile",
11+
"//bolt/lib/Rewrite",
12+
"//bolt/lib/Utils",
13+
"//llvm/lib/DebugInfo/DWARF",
14+
"//llvm/lib/MC",
15+
"//llvm/lib/Object",
16+
"//llvm/lib/Target:TargetsToBuild",
17+
]
18+
sources = [ "InsertNegateRAState.cpp" ]
19+
20+
defines = []
21+
include_dirs = []
22+
if (llvm_build_AArch64) {
23+
defines += [ "AARCH64_AVAILABLE" ]
24+
25+
# This target reaches into the internal headers of LLVM's AArch64 library.
26+
# That target doesn't expect that, so it doesn't use public_deps for
27+
# tblgen-generated headers used only in internal headers (...which this
28+
# target here questionably includes). So depend on the target that generates
29+
# those headers here.
30+
include_dirs += [ "//llvm/lib/Target/AArch64" ]
31+
deps += [
32+
"//llvm/lib/Target/AArch64:AArch64GenSDNodeInfo",
33+
"//llvm/lib/Target/AArch64/MCTargetDesc",
34+
"//llvm/lib/Target/AArch64/Utils",
35+
]
36+
}
37+
if (llvm_build_X86) {
38+
defines += [ "X86_AVAILABLE" ]
39+
40+
# This target reaches into the internal headers of LLVM's X86 library.
41+
# That target doesn't expect that, so it doesn't use public_deps for
42+
# tblgen-generated headers used only in internal headers (...which this
43+
# target here questionably includes). So depend on the target that generates
44+
# those headers here.
45+
include_dirs += [ "//llvm/lib/Target/X86" ]
46+
deps += [ "//llvm/lib/Target/X86/MCTargetDesc" ]
47+
}
48+
}

llvm/utils/gn/secondary/llvm/lib/Target/AArch64/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ tablegen("AArch64GenSDNodeInfo") {
7676
visibility = [
7777
":LLVMAArch64CodeGen",
7878
"//bolt/unittests/Core:CoreTests",
79+
"//bolt/unittests/Passes:PassTests",
7980
"//llvm/unittests/Target/AArch64:AArch64Tests",
8081
]
8182
args = [ "-gen-sd-node-info" ]

0 commit comments

Comments
 (0)