Skip to content

Commit 4453792

Browse files
committed
[gn] port 7daa1de (CGPluginTest)
The test isn't passing for me locally yet, so it's not yet part of the build.
1 parent f964922 commit 4453792

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ static_library("Target") {
3939
"//llvm/include/llvm/Config:write_target_def_files",
4040
]
4141
sources = [
42+
"RegisterTargetPassConfigCallback.cpp",
4243
"Target.cpp",
4344
"TargetLoweringObjectFile.cpp",
4445
"TargetMachine.cpp",

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ group("unittests") {
1010
"Bitstream:BitstreamTests",
1111
"CGData:CodeGenDataTests",
1212
"CodeGen:CodeGenTests",
13+
14+
# FIXME: Figure out how to make pass.
15+
# "CodeGen/CGPluginTest",
1316
"CodeGen/GlobalISel:GlobalISelTests",
1417
"DWARFLinkerParallel:DWARFLinkerParallelTests",
1518
"DebugInfo/BTF:DebugInfoBTFTests",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import("//third-party/unittest/unittest.gni")
2+
3+
unittest("CGPluginTest") {
4+
deps = [
5+
"Plugin:CGTestPlugin",
6+
"//llvm/lib/IR",
7+
"//llvm/lib/MC",
8+
"//llvm/lib/Support",
9+
"//llvm/lib/Target",
10+
"//llvm/lib/Target:TargetsToBuild",
11+
"//llvm/lib/TargetParser",
12+
"//llvm/lib/Testing/Support",
13+
]
14+
sources = [
15+
"PluginTest.cpp",
16+
"Plugin/CodeGenTestPass.cpp",
17+
]
18+
19+
# Support plugins.
20+
# FIXME: Disable dead stripping once other binaries are dead-stripped.
21+
if (host_os != "mac" && host_os != "win") {
22+
# Corresponds to export_executable_symbols() in cmake.
23+
ldflags = [ "-rdynamic" ]
24+
}
25+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
loadable_module("CGTestPlugin") {
2+
# Put plugin next to the unit test executable.
3+
output_dir = "$target_out_dir/.."
4+
5+
sources = [
6+
"Plugin.cpp",
7+
"CodeGenTestPass.cpp",
8+
]
9+
10+
if (host_os != "mac" && host_os != "win") {
11+
# The GN build currently doesn't globally pass -fPIC, but that's
12+
# needed for building .so files on ELF. Just pass it manually
13+
# for loadable_modules for now.
14+
cflags = [ "-fPIC" ]
15+
}
16+
}

0 commit comments

Comments
 (0)