import("//llvm/lib/Target/targets.gni")

group("unittests") {
  deps = [
    "ADT:ADTTests",
    "Analysis:AnalysisTests",
    "AsmParser:AsmParserTests",
    "BinaryFormat:BinaryFormatTests",
    "Bitcode:BitcodeTests",
    "Bitstream:BitstreamTests",
    "CodeGen:CodeGenTests",
    "CodeGen/GlobalISel:GlobalISelTests",
    "DebugInfo/CodeView:DebugInfoCodeViewTests",
    "DebugInfo/DWARF:DebugInfoDWARFTests",
    "DebugInfo/GSYM:DebugInfoGSYMTests",
    "DebugInfo/MSF:DebugInfoMSFTests",
    "DebugInfo/PDB:DebugInfoPDBTests",
    "Demangle:DemangleTests",
    "ExecutionEngine:ExecutionEngineTests",
    "ExecutionEngine/JITLink:JITLinkTests",
    "ExecutionEngine/MCJIT:MCJITTests",
    "ExecutionEngine/Orc:OrcJITTests",
    "FuzzMutate:FuzzMutateTests",
    "IR:IRTests",
    "LineEditor:LineEditorTests",
    "Linker:LinkerTests",
    "MC:MCTests",
    "MI:MITests",
    "Object:ObjectTests",
    "ObjectYAML:ObjectYAMLTests",
    "Option:OptionTests",
    "Passes:PluginsTests",
    "ProfileData:ProfileDataTests",
    "Remarks:RemarksTests",
    "Support:SupportTests",
    "Support/DynamicLibrary:DynamicLibraryTests",
    "TextAPI:TextAPITests",
    "Transforms/IPO:IPOTests",
    "Transforms/Scalar:ScalarTests",
    "Transforms/Utils:UtilsTests",
    "Transforms/Vectorize:VectorizeTests",
    "XRay:XRayTests",
    "tools/llvm-cfi-verify:CFIVerifyTests",
    "tools/llvm-exegesis:LLVMExegesisTests",
  ]

  # Target-dependent unit tests.
  # FIXME: This matches how they are set up in the cmake build,
  # but if we disable an arch after building with it on, this
  # setup leaves behind stale executables.
  if (llvm_build_AArch64) {
    deps += [
      "Target/AArch64:AArch64Tests",
      "tools/llvm-exegesis/AArch64:LLVMExegesisAArch64Tests",
    ]
  }
  if (llvm_build_ARM) {
    deps += [
      "Target/ARM:ARMTests",
      "tools/llvm-exegesis/ARM:LLVMExegesisARMTests",
    ]
  }
  if (llvm_build_WebAssembly) {
    deps += [ "Target/WebAssembly:WebAssemblyTests" ]
  }
  if (llvm_build_PowerPC) {
    deps += [ "tools/llvm-exegesis/PowerPC:LLVMExegesisPowerPCTests" ]
  }
  if (llvm_build_X86) {
    deps += [ "tools/llvm-exegesis/X86:LLVMExegesisX86Tests" ]
  }

  testonly = true
}
