"BinaryFormat:BinaryFormatTests",
"Bitcode:BitcodeTests",
"CodeGen:CodeGenTests",
-
- # FIXME: Add.
- #"CodeGen/GlobalISel:GlobalISelTests",
+ "CodeGen/GlobalISel:GlobalISelTests",
"DebugInfo/CodeView:DebugInfoCodeViewTests",
"DebugInfo/DWARF:DebugInfoDWARFTests",
"DebugInfo/MSF:DebugInfoMSFTests",
"LineEditor:LineEditorTests",
"Linker:LinkerTests",
"MC:MCTests",
-
- # FIXME: Add.
- #"MI:MITests",
+ "MI:MITests",
"Object:ObjectTests",
"ObjectYAML:ObjectYAMLTests",
"OptRemarks:OptRemarksTests",
"Transforms/Utils:UtilsTests",
"Transforms/Vectorize:VectorizeTests",
"XRay:XRayTests",
-
- # FIXME: Add more:
- #"tools/llvm-cfi-verify:CFIVerifyTests",
+ "tools/llvm-cfi-verify:CFIVerifyTests",
"tools/llvm-exegesis:LLVMExegesisTests",
]
--- /dev/null
+import("//llvm/utils/unittest/unittest.gni")
+
+unittest("GlobalISelTests") {
+ deps = [
+ "//llvm/lib/CodeGen",
+ "//llvm/lib/CodeGen/GlobalISel",
+ "//llvm/lib/CodeGen/MIRParser",
+ "//llvm/lib/IR",
+ "//llvm/lib/MC",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target",
+ "//llvm/lib/Target:TargetsToBuild",
+ ]
+ sources = [
+ "LegalizerHelperTest.cpp",
+ "LegalizerInfoTest.cpp",
+ "PatternMatchTest.cpp",
+ ]
+ has_custom_main = true
+}
--- /dev/null
+import("//llvm/utils/unittest/unittest.gni")
+
+unittest("MITests") {
+ deps = [
+ "//llvm/lib/CodeGen",
+ "//llvm/lib/CodeGen/MIRParser",
+ "//llvm/lib/IR",
+ "//llvm/lib/MC",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target",
+ "//llvm/lib/Target:TargetsToBuild",
+ ]
+ sources = [
+ "LiveIntervalTest.cpp",
+ ]
+ has_custom_main = true
+}
--- /dev/null
+import("//llvm/utils/unittest/unittest.gni")
+
+unittest("CFIVerifyTests") {
+ deps = [
+ "//llvm/lib/DebugInfo/Symbolize",
+ "//llvm/lib/MC",
+ "//llvm/lib/MC/MCParser",
+ "//llvm/lib/Object",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target:AllTargetsAsmParsers",
+ "//llvm/lib/Target:AllTargetsAsmPrinters",
+ "//llvm/lib/Target:AllTargetsDescs",
+ "//llvm/lib/Target:AllTargetsDisassemblers",
+ "//llvm/lib/Target:AllTargetsInfos",
+ "//llvm/tools/llvm-cfi-verify/lib",
+ ]
+ sources = [
+ "FileAnalysis.cpp",
+ "GraphBuilder.cpp",
+ ]
+ has_custom_main = true
+}
# This file defines a template for adding a unittest binary.
#
# It's a thin wrapper around GN's built-in executable() target type and
-# accepts the same parameters.
+# accepts the same parameters, and in addition this paramater:
+#
+# has_custom_main (optional)
+# [bool] If set, link against gtest instead of UnitTestMain; for tests
+# that define their own main() function.
#
# Example use:
#
template("unittest") {
executable(target_name) {
- # Foward everything (configs, sources, deps, ...).
+ has_custom_main = false # Default value.
+
+ # Foward everything (has_custom_main if set; configs, sources, deps, ...).
forward_variables_from(invoker, "*")
assert(!defined(invoker.output_dir), "cannot set unittest output_dir")
assert(!defined(invoker.testonly), "cannot set unittest testonly")
# If you change output_dir here, look through
# `git grep target_out_dir '*/unittests/*'` and update those too.
output_dir = target_out_dir
- deps += [ "//llvm/utils/unittest/UnitTestMain" ]
+
+ if (has_custom_main) {
+ deps += [ "//llvm/utils/unittest:gtest" ]
+ } else {
+ deps += [ "//llvm/utils/unittest/UnitTestMain" ]
+ }
testonly = true
}
}