Debian Codegraph @

utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel

raw
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5 load("@rules_cc//cc:defs.bzl", "cc_library", "cc_shared_library", "cc_test")
6 load("//mlir:tblgen.bzl", "gentbl_cc_library")
7
8 package(
9 default_visibility = ["//visibility:public"],
10 features = ["layering_check"],
11 )
12
13 licenses(["notice"])
14
15 cc_test(
16 name = "adt_tests",
17 size = "medium",
18 srcs = glob(
19 [
20 "ADT/*.cpp",
21 "ADT/*.h",
22 ],
23 allow_empty = False,
24 ),
25 shard_count = 20,
26 deps = [
27 "//llvm:Core",
28 "//llvm:Support",
29 "//llvm:TestingSupport",
30 "//llvm:config",
31 "//third-party/unittest:gmock",
32 "//third-party/unittest:gtest",
33 "//third-party/unittest:gtest_main",
34 ],
35 )
36
37 cc_library(
38 name = "inline_advisor_plugin",
39 srcs = glob(["Analysis/InlineAdvisorPlugin/*.cpp"]),
40 deps = [
41 "//llvm:Analysis",
42 "//llvm:Core",
43 "//llvm:Passes",
44 "//llvm:Plugins",
45 "//llvm:Support",
46 ],
47 )
48
49 cc_shared_library(
50 name = "inline_advisor_plugin_shared",
51 shared_lib_name = "InlineAdvisorPlugin.so",
52 deps = [":inline_advisor_plugin"],
53 )
54
55 cc_test(
56 name = "plugin_inline_advisor_analysis_test",
57 srcs = ["Analysis/PluginInlineAdvisorAnalysisTest.cpp"],
58 data = [
59 ":inline_advisor_plugin_shared",
60 ],
61 deps = [
62 "//llvm:Analysis",
63 "//llvm:AsmParser",
64 "//llvm:Core",
65 "//llvm:Passes",
66 "//llvm:Plugins",
67 "//llvm:Support",
68 "//llvm:TestingSupport",
69 "//llvm:attributes_gen",
70 "//llvm:config",
71 "//third-party/unittest:gtest",
72 "//third-party/unittest:gtest_main",
73 ],
74 )
75
76 cc_library(
77 name = "inline_order_plugin",
78 srcs = glob(["Analysis/InlineOrderPlugin/*.cpp"]),
79 deps = [
80 "//llvm:Analysis",
81 "//llvm:Core",
82 "//llvm:Passes",
83 "//llvm:Plugins",
84 "//llvm:Support",
85 ],
86 )
87
88 cc_shared_library(
89 name = "inline_order_plugin_shared",
90 shared_lib_name = "InlineOrderPlugin.so",
91 deps = [":inline_order_plugin"],
92 )
93
94 cc_test(
95 name = "plugin_inline_order_analysis_test",
96 srcs = ["Analysis/PluginInlineOrderAnalysisTest.cpp"],
97 data = [
98 ":inline_order_plugin_shared",
99 ],
100 deps = [
101 "//llvm:Analysis",
102 "//llvm:AsmParser",
103 "//llvm:Core",
104 "//llvm:Passes",
105 "//llvm:Plugins",
106 "//llvm:Support",
107 "//llvm:TestingSupport",
108 "//llvm:attributes_gen",
109 "//llvm:config",
110 "//third-party/unittest:gtest",
111 "//third-party/unittest:gtest_main",
112 ],
113 )
114
115 cc_test(
116 name = "analysis_tests",
117 size = "small",
118 srcs = glob(
119 ["Analysis/*.cpp"],
120 allow_empty = False,
121 exclude = [
122 # TODO: Add this file to the build.
123 "Analysis/ConstraintSystemTest.cpp",
124 "Analysis/TFUtilsTest.cpp",
125 "Analysis/TrainingLoggerTest.cpp",
126 "Analysis/MLModelRunnerTest.cpp",
127 # These tests dynamically load Plugins which both pull in
128 # llvm/lib/Analysis/ProfileSummaryInfo.cpp, which registers flags;
129 # if built into the same cc_test target, those flags will be
130 # registered twice and cause runtime failures.
131 "Analysis/PluginInlineAdvisorAnalysisTest.cpp",
132 "Analysis/PluginInlineOrderAnalysisTest.cpp",
133 ],
134 ),
135 deps = [
136 "//llvm:Analysis",
137 "//llvm:AsmParser",
138 "//llvm:CodeGen",
139 "//llvm:Core",
140 "//llvm:FrontendHLSL",
141 "//llvm:Instrumentation",
142 "//llvm:Passes",
143 "//llvm:Plugins",
144 "//llvm:Support",
145 "//llvm:TargetParser",
146 "//llvm:TestingSupport",
147 "//llvm:TransformUtils",
148 "//llvm:attributes_gen",
149 "//llvm:config",
150 "//third-party/unittest:gmock",
151 "//third-party/unittest:gtest",
152 "//third-party/unittest:gtest_main",
153 ],
154 )
155
156 cc_test(
157 name = "asm_parser_tests",
158 size = "small",
159 srcs = glob(
160 ["AsmParser/*.cpp"],
161 allow_empty = False,
162 ),
163 deps = [
164 "//llvm:AsmParser",
165 "//llvm:Core",
166 "//llvm:Support",
167 "//third-party/unittest:gtest",
168 "//third-party/unittest:gtest_main",
169 ],
170 )
171
172 cc_test(
173 name = "bitcode_tests",
174 size = "small",
175 srcs = glob(
176 [
177 "Bitcode/*.cpp",
178 "Bitcode/*.h",
179 ],
180 allow_empty = False,
181 ),
182 deps = [
183 "//llvm:AsmParser",
184 "//llvm:BitReader",
185 "//llvm:BitWriter",
186 "//llvm:Core",
187 "//llvm:Support",
188 "//third-party/unittest:gtest",
189 "//third-party/unittest:gtest_main",
190 ],
191 )
192
193 cc_test(
194 name = "bitstream_tests",
195 size = "small",
196 srcs = glob(
197 ["Bitstream/*.cpp"],
198 allow_empty = False,
199 ),
200 deps = [
201 "//llvm:BitstreamReader",
202 "//llvm:BitstreamWriter",
203 "//llvm:Support",
204 "//llvm:TestingSupport",
205 "//third-party/unittest:gmock",
206 "//third-party/unittest:gtest",
207 "//third-party/unittest:gtest_main",
208 ],
209 )
210
211 cc_test(
212 name = "cgdata_tests",
213 size = "small",
214 srcs = glob(
215 ["CGData/*.cpp"],
216 allow_empty = False,
217 ),
218 deps = [
219 "//llvm:CGData",
220 "//llvm:CodeGen",
221 "//llvm:Core",
222 "//llvm:Support",
223 "//third-party/unittest:gmock",
224 "//third-party/unittest:gtest",
225 "//third-party/unittest:gtest_main",
226 ],
227 )
228
229 cc_library(
230 name = "codegen_tests_includes",
231 textual_hdrs = glob(
232 ["CodeGen/*.inc"],
233 allow_empty = False,
234 ),
235 )
236
237 cc_test(
238 name = "codegen_tests",
239 size = "medium",
240 srcs = glob(
241 [
242 "CodeGen/*.cpp",
243 "CodeGen/*.h",
244 ],
245 allow_empty = False,
246 ),
247 features = ["-layering_check"], # #include "../lib/CodeGen/AllocationOrder.h"
248 deps = [
249 ":codegen_tests_includes",
250 "//llvm:AllTargetsAsmParsers",
251 "//llvm:AllTargetsCodeGens",
252 "//llvm:Analysis",
253 "//llvm:AsmParser",
254 "//llvm:BinaryFormat",
255 "//llvm:CodeGen",
256 "//llvm:CodeGenTypes",
257 "//llvm:Core",
258 "//llvm:MC",
259 "//llvm:Passes",
260 "//llvm:Plugins",
261 "//llvm:Support",
262 "//llvm:Target",
263 "//llvm:TestingSupport",
264 "//third-party/unittest:gtest",
265 ],
266 )
267
268 cc_test(
269 name = "codegen_globalisel_tests",
270 size = "small",
271 srcs = glob(
272 [
273 "CodeGen/GlobalISel/*.cpp",
274 "CodeGen/GlobalISel/*.h",
275 ],
276 allow_empty = False,
277 ),
278 copts = [
279 "$(STACK_FRAME_UNLIMITED)",
280 ],
281 deps = [
282 "//llvm:AllTargetsAsmParsers",
283 "//llvm:AllTargetsCodeGens",
284 "//llvm:AsmParser",
285 "//llvm:CodeGen",
286 "//llvm:CodeGenTypes",
287 "//llvm:Core",
288 "//llvm:FileCheckLib",
289 "//llvm:MC",
290 "//llvm:Support",
291 "//llvm:Target",
292 "//third-party/unittest:gtest",
293 ],
294 )
295
296 cc_test(
297 name = "debuginfo_tests",
298 size = "medium",
299 srcs = glob(
300 [
301 "DebugInfo/DWARF/*.cpp",
302 "DebugInfo/DWARF/*.h",
303 # TODO: Re-enable these when they stop crashing.
304 #"DebugInfo/PDB/*.cpp",
305 #"DebugInfo/PDB/*.h",
306 ],
307 allow_empty = False,
308 ),
309 args = [
310 # Skip a test that relies on reading files in a way that doesn't easily
311 # work with Bazel.
312 "--gtest_filter=-NativeSymbolReuseTest.*",
313 ],
314 features = ["-layering_check"], # #include "../lib/CodeGen/AsmPrinter/DwarfStringPool.h"
315 deps = [
316 "//llvm:AllTargetsAsmParsers",
317 "//llvm:AllTargetsCodeGens",
318 "//llvm:BinaryFormat",
319 "//llvm:CodeGenTypes",
320 "//llvm:Core",
321 "//llvm:DebugInfo",
322 "//llvm:DebugInfoDWARF",
323 "//llvm:DebugInfoPDB",
324 "//llvm:MC",
325 "//llvm:Object",
326 "//llvm:ObjectYAML",
327 "//llvm:Support",
328 "//llvm:Target",
329 "//llvm:TestingSupport",
330 "//llvm:config",
331 "//third-party/unittest:gtest",
332 "//third-party/unittest:gtest_main",
333 ],
334 )
335
336 cc_test(
337 name = "debuginfod_tests",
338 srcs = glob(["Debuginfod/*.cpp"]),
339 deps = [
340 "//llvm:Debuginfod",
341 "//llvm:Support",
342 "//llvm:TestingSupport",
343 "//third-party/unittest:gmock",
344 "//third-party/unittest:gtest",
345 "//third-party/unittest:gtest_main",
346 ],
347 )
348
349 cc_test(
350 name = "execution_engine_tests",
351 size = "small",
352 srcs = glob(
353 ["ExecutionEngine/*.cpp"],
354 allow_empty = False,
355 ),
356 deps = [
357 "//llvm:AllTargetsCodeGens",
358 "//llvm:AsmParser",
359 "//llvm:Core",
360 "//llvm:ExecutionEngine",
361 "//llvm:Interpreter",
362 "//llvm:Support",
363 "//third-party/unittest:gtest",
364 "//third-party/unittest:gtest_main",
365 ],
366 )
367
368 cc_test(
369 name = "execution_engine_mcjit_tests",
370 size = "medium",
371 srcs = glob(
372 [
373 "ExecutionEngine/MCJIT/*.cpp",
374 "ExecutionEngine/MCJIT/*.h",
375 ],
376 allow_empty = False,
377 ),
378 copts = [
379 "$(STACK_FRAME_UNLIMITED)",
380 ],
381 deps = [
382 "//llvm:AllTargetsCodeGens",
383 "//llvm:Analysis",
384 "//llvm:AsmParser",
385 "//llvm:Core",
386 "//llvm:ExecutionEngine",
387 "//llvm:MC",
388 "//llvm:MCJIT",
389 "//llvm:Passes",
390 "//llvm:Plugins",
391 "//llvm:Support",
392 "//llvm:Target",
393 "//llvm:TargetParser",
394 "//llvm:config",
395 "//third-party/unittest:gtest",
396 "//third-party/unittest:gtest_main",
397 ],
398 )
399
400 cc_test(
401 name = "execution_engine_orc_tests",
402 size = "medium",
403 srcs = glob(
404 [
405 "ExecutionEngine/Orc/*.cpp",
406 "ExecutionEngine/Orc/*.h",
407 ],
408 allow_empty = False,
409 ),
410 args = [
411 # keep one-per-line
412 "--gtest_filter=-ObjectLinkingLayerTest.TestSetProcessAllSections",
413 ],
414 linkopts = select({
415 "@platforms//os:macos": [],
416 "@platforms//os:windows": [],
417 "//conditions:default": [
418 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBAllocAction",
419 ],
420 }),
421 deps = [
422 "//llvm:AllTargetsAsmParsers",
423 "//llvm:AllTargetsCodeGens",
424 "//llvm:Analysis",
425 "//llvm:AsmParser",
426 "//llvm:BinaryFormat",
427 "//llvm:Core",
428 "//llvm:ExecutionEngine",
429 "//llvm:IRReader",
430 "//llvm:JITLink",
431 "//llvm:MC",
432 "//llvm:Object",
433 "//llvm:ObjectYAML",
434 "//llvm:OrcDebugging",
435 "//llvm:OrcJIT",
436 "//llvm:OrcShared",
437 "//llvm:OrcTargetProcess",
438 "//llvm:Support",
439 "//llvm:TargetParser",
440 "//llvm:TestingSupport",
441 "//llvm:config",
442 "//third-party/unittest:gtest",
443 "//third-party/unittest:gtest_main",
444 ],
445 )
446
447 cc_test(
448 name = "filecheck_tests",
449 size = "small",
450 srcs = glob(
451 ["FileCheck/*.cpp"],
452 allow_empty = False,
453 ),
454 features = ["-layering_check"], # #include "../lib/FileCheck/FileCheckImpl.h"
455 deps = [
456 "//llvm:FileCheckLib",
457 "//llvm:Support",
458 "//llvm:TestingSupport",
459 "//third-party/unittest:gtest",
460 "//third-party/unittest:gtest_main",
461 ],
462 )
463
464 cc_test(
465 name = "ir_tests",
466 size = "medium",
467 timeout = "long", # ConstantRangeTest cases may take several seconds each.
468 srcs = glob(
469 [
470 "IR/*.cpp",
471 "IR/*.h",
472 ],
473 allow_empty = False,
474 ) + [
475 "Support/KnownBitsTest.h",
476 ],
477 features = ["-layering_check"],
478 shard_count = 20,
479 deps = [
480 "//llvm:Analysis",
481 "//llvm:AsmParser",
482 "//llvm:BinaryFormat",
483 "//llvm:CodeGen",
484 "//llvm:Core",
485 "//llvm:Passes",
486 "//llvm:Plugins",
487 "//llvm:Scalar",
488 "//llvm:Support",
489 "//llvm:TargetParser",
490 "//llvm:TestingSupport",
491 "//llvm:TransformUtils",
492 "//llvm:config",
493 "//third-party/unittest:gmock",
494 "//third-party/unittest:gtest",
495 "//third-party/unittest:gtest_main",
496 ],
497 )
498
499 cc_test(
500 name = "line_editor_tests",
501 size = "small",
502 srcs = glob(
503 ["LineEditor/*.cpp"],
504 allow_empty = False,
505 ),
506 deps = [
507 "//llvm:LineEditor",
508 "//llvm:Support",
509 "//third-party/unittest:gtest",
510 "//third-party/unittest:gtest_main",
511 ],
512 )
513
514 cc_test(
515 name = "frontend_tests",
516 size = "small",
517 srcs = glob(
518 ["Frontend/*.cpp"],
519 allow_empty = False,
520 ),
521 deps = [
522 "//llvm:Analysis",
523 "//llvm:Core",
524 "//llvm:FrontendHLSL",
525 "//llvm:FrontendOffloading",
526 "//llvm:FrontendOpenACC",
527 "//llvm:FrontendOpenMP",
528 "//llvm:Passes",
529 "//llvm:Plugins",
530 "//llvm:Support",
531 "//llvm:TargetParser",
532 "//llvm:TestingSupport",
533 "//llvm:TransformUtils",
534 "//third-party/unittest:gmock",
535 "//third-party/unittest:gtest",
536 "//third-party/unittest:gtest_main",
537 ],
538 )
539
540 cc_test(
541 name = "linker_tests",
542 size = "small",
543 srcs = glob(
544 ["Linker/*.cpp"],
545 allow_empty = False,
546 ),
547 deps = [
548 "//llvm:AsmParser",
549 "//llvm:Core",
550 "//llvm:Linker",
551 "//llvm:Support",
552 "//third-party/unittest:gtest",
553 "//third-party/unittest:gtest_main",
554 ],
555 )
556
557 cc_test(
558 name = "mc_tests",
559 size = "small",
560 srcs = glob(
561 ["MC/*.cpp"],
562 allow_empty = False,
563 ),
564 deps = [
565 "//llvm:AllTargetsCodeGens",
566 "//llvm:AllTargetsDisassemblers",
567 "//llvm:BinaryFormat",
568 "//llvm:MC",
569 "//llvm:MCDisassembler",
570 "//llvm:Object",
571 "//llvm:Support",
572 "//llvm:Target",
573 "//third-party/unittest:gtest",
574 "//third-party/unittest:gtest_main",
575 ],
576 )
577
578 cc_test(
579 name = "mi_tests",
580 size = "medium",
581 srcs = glob(
582 ["MI/*.cpp"],
583 allow_empty = False,
584 ),
585 features = ["-layering_check"], # #include "../lib/CodeGen/RegisterCoalescer.h"
586 deps = [
587 "//llvm:AllTargetsAsmParsers",
588 "//llvm:AllTargetsCodeGens",
589 "//llvm:CodeGen",
590 "//llvm:CodeGenTypes",
591 "//llvm:Core",
592 "//llvm:MC",
593 "//llvm:Support",
594 "//llvm:Target",
595 "//third-party/unittest:gtest",
596 ],
597 )
598
599 cc_test(
600 name = "objcopy_tests",
601 srcs = glob(
602 ["ObjCopy/*.cpp"],
603 allow_empty = False,
604 ),
605 deps = [
606 "//llvm:ObjCopy",
607 "//llvm:Object",
608 "//llvm:ObjectYAML",
609 "//llvm:Support",
610 "//llvm:TestingSupport",
611 "//third-party/unittest:gtest",
612 "//third-party/unittest:gtest_main",
613 ],
614 )
615
616 cc_test(
617 name = "object_tests",
618 size = "small",
619 srcs = glob(
620 ["Object/*.cpp"],
621 allow_empty = False,
622 ),
623 deps = [
624 "//llvm:BinaryFormat",
625 "//llvm:Object",
626 "//llvm:ObjectYAML",
627 "//llvm:Support",
628 "//llvm:TargetParser",
629 "//llvm:TestingSupport",
630 "//third-party/unittest:gmock",
631 "//third-party/unittest:gtest",
632 "//third-party/unittest:gtest_main",
633 ],
634 )
635
636 cc_test(
637 name = "object_yaml_tests",
638 size = "small",
639 srcs = glob(
640 ["ObjectYAML/*.cpp"],
641 allow_empty = False,
642 ),
643 deps = [
644 "//llvm:DebugInfoCodeView",
645 "//llvm:Object",
646 "//llvm:ObjectYAML",
647 "//llvm:Support",
648 "//llvm:TestingSupport",
649 "//third-party/unittest:gtest",
650 "//third-party/unittest:gtest_main",
651 ],
652 )
653
654 gentbl_cc_library(
655 name = "option_tests_gen",
656 strip_include_prefix = "Option",
657 tbl_outs = {"Option/Opts.inc": ["-gen-opt-parser-defs"]},
658 tblgen = "//llvm:llvm-tblgen",
659 td_file = "Option/Opts.td",
660 deps = ["//llvm:OptParserTdFiles"],
661 )
662
663 gentbl_cc_library(
664 name = "sub_command_opts_tests_gen",
665 strip_include_prefix = "Option",
666 tbl_outs = {"Option/SubCommandOpts.inc": ["-gen-opt-parser-defs"]},
667 tblgen = "//llvm:llvm-tblgen",
668 td_file = "Option/SubCommandOpts.td",
669 deps = ["//llvm:OptParserTdFiles"],
670 )
671
672 gentbl_cc_library(
673 name = "automata_gen",
674 strip_include_prefix = "TableGen",
675 tbl_outs = {
676 "TableGen/AutomataAutomata.inc": ["-gen-automata"],
677 "TableGen/AutomataTables.inc": ["-gen-searchable-tables"],
678 },
679 tblgen = "//llvm:llvm-tblgen",
680 td_file = "TableGen/Automata.td",
681 deps = ["//llvm:CommonTargetTdFiles"],
682 )
683
684 cc_test(
685 name = "option_tests",
686 size = "small",
687 srcs = glob(
688 ["Option/*.cpp"],
689 allow_empty = False,
690 ),
691 deps = [
692 ":option_tests_gen",
693 ":sub_command_opts_tests_gen",
694 "//llvm:Option",
695 "//llvm:Support",
696 "//third-party/unittest:gtest",
697 "//third-party/unittest:gtest_main",
698 ],
699 )
700
701 cc_test(
702 name = "remarks_tests",
703 size = "small",
704 srcs = glob(
705 ["Remarks/*.cpp"],
706 allow_empty = False,
707 ),
708 deps = [
709 "//llvm:BitReader",
710 "//llvm:Remarks",
711 "//llvm:Support",
712 "//llvm:remark_linker",
713 "//third-party/unittest:gtest",
714 "//third-party/unittest:gtest_main",
715 ],
716 )
717
718 cc_test(
719 name = "sandboxir_tests",
720 size = "small",
721 srcs = glob(
722 ["SandboxIR/*.cpp"],
723 allow_empty = False,
724 ),
725 deps = [
726 "//llvm:Analysis",
727 "//llvm:AsmParser",
728 "//llvm:Core",
729 "//llvm:SandboxIR",
730 "//llvm:Support",
731 "//third-party/unittest:gmock",
732 "//third-party/unittest:gtest",
733 ],
734 )
735
736 cc_test(
737 name = "profile_data_tests",
738 size = "small",
739 srcs = glob(
740 ["ProfileData/*.cpp"],
741 allow_empty = False,
742 ),
743 deps = [
744 "//llvm:BitReader",
745 "//llvm:Core",
746 "//llvm:Coverage",
747 "//llvm:DebugInfo",
748 "//llvm:Object",
749 "//llvm:ProfileData",
750 "//llvm:Support",
751 "//llvm:Symbolize",
752 "//llvm:TestingSupport",
753 "//third-party/unittest:gmock",
754 "//third-party/unittest:gtest",
755 "//third-party/unittest:gtest_main",
756 ],
757 )
758
759 # Note that the name of this test is important as it is used in the test itself.
760 cc_test(
761 name = "SupportTests",
762 size = "medium",
763 srcs = glob(
764 [
765 "Support/*.cpp",
766 "Support/*.h",
767 ],
768 allow_empty = False,
769 exclude = [
770 "Support/ParallelTest.cpp",
771 ],
772 ),
773 args = [
774 # keep one-per-line
775 "--gtest_filter=-ProgramTest.CreateProcessTrailingSlash",
776 ],
777 copts = [
778 "$(STACK_FRAME_UNLIMITED)",
779 ],
780 linkstatic = 1,
781 tags = [
782 "no-sandbox", # FileSystemTest.permissions not compatible with the sandbox on MacOS
783 ],
784 deps = [
785 "//llvm:AllTargetsCodeGens",
786 "//llvm:BinaryFormat",
787 "//llvm:Core",
788 "//llvm:ProfileData",
789 "//llvm:Support",
790 "//llvm:TargetParser",
791 "//llvm:TestingSupport",
792 "//llvm:config",
793 "//third-party/unittest:gmock",
794 "//third-party/unittest:gtest",
795 "//third-party/unittest:gtest_main",
796 ],
797 )
798
799 cc_test(
800 name = "support_parallel_tests",
801 size = "small",
802 srcs = ["Support/ParallelTest.cpp"],
803 copts = [
804 "$(STACK_FRAME_UNLIMITED)",
805 ],
806 linkstatic = 1,
807 deps = [
808 "//llvm:AllTargetsCodeGens",
809 "//llvm:Support",
810 "//llvm:config",
811 "//third-party/unittest:gtest",
812 "//third-party/unittest:gtest_main",
813 ],
814 )
815
816 cc_test(
817 name = "SupportLSPTests",
818 size = "small",
819 srcs = glob(["Support/LSP/*.cpp"]),
820 copts = [
821 "$(STACK_FRAME_UNLIMITED)",
822 ],
823 linkstatic = 1,
824 deps = [
825 "//llvm:Support",
826 "//llvm:config",
827 "//third-party/unittest:gmock",
828 "//third-party/unittest:gtest",
829 "//third-party/unittest:gtest_main",
830 ],
831 )
832
833 cc_test(
834 name = "tablegen_tests",
835 size = "small",
836 srcs = glob(
837 [
838 "TableGen/*.cpp",
839 ],
840 allow_empty = False,
841 ),
842 deps = [
843 ":automata_gen",
844 "//llvm:Support",
845 "//llvm:TableGen",
846 "//llvm:TableGenGlobalISel",
847 "//third-party/unittest:gmock",
848 "//third-party/unittest:gtest",
849 "//third-party/unittest:gtest_main",
850 ],
851 )
852
853 cc_test(
854 name = "target_aarch64_tests",
855 size = "small",
856 srcs = glob(
857 ["Target/AArch64/*.cpp"],
858 allow_empty = False,
859 ),
860 copts = [
861 "$(STACK_FRAME_UNLIMITED)",
862 ],
863 features = ["-layering_check"], # #include "AArch64GenInstrInfo.inc"
864 deps = [
865 "//llvm:AArch64CodeGen",
866 "//llvm:AArch64UtilsAndDesc",
867 "//llvm:AsmParser",
868 "//llvm:CodeGen",
869 "//llvm:CodeGenTypes",
870 "//llvm:Core",
871 "//llvm:MC",
872 "//llvm:Support",
873 "//llvm:Target",
874 "//third-party/unittest:gtest",
875 "//third-party/unittest:gtest_main",
876 ],
877 )
878
879 cc_test(
880 name = "testing_adt_tests",
881 size = "small",
882 srcs = glob(
883 [
884 "Testing/ADT/*.cpp",
885 ],
886 allow_empty = False,
887 ),
888 deps = [
889 "//llvm:Support",
890 "//llvm:TestingADT",
891 "//third-party/unittest:gtest",
892 "//third-party/unittest:gtest_main",
893 ],
894 )
895
896 cc_test(
897 name = "transforms_tests",
898 size = "small",
899 srcs = glob(
900 [
901 "Transforms/IPO/*.cpp",
902 "Transforms/IPO/*.h",
903 "Transforms/Utils/*.cpp",
904 ],
905 allow_empty = False,
906 ),
907 deps = [
908 "//llvm:Analysis",
909 "//llvm:AsmParser",
910 "//llvm:Core",
911 "//llvm:IPO",
912 "//llvm:IRReader",
913 "//llvm:Passes",
914 "//llvm:Plugins",
915 "//llvm:ProfileData",
916 "//llvm:Support",
917 "//llvm:TestingSupport",
918 "//llvm:TransformUtils",
919 "//llvm:Vectorize",
920 "//third-party/unittest:gmock",
921 "//third-party/unittest:gtest",
922 "//third-party/unittest:gtest_main",
923 ],
924 )
925
926 cc_test(
927 name = "llvm_exegesis_tests",
928 size = "small",
929 srcs = glob(
930 [
931 "tools/llvm-exegesis/*.cpp",
932 "tools/llvm-exegesis/X86/*.cpp",
933 "tools/llvm-exegesis/X86/*.h",
934 ],
935 allow_empty = False,
936 ) + [
937 "tools/llvm-exegesis/Common/AssemblerUtils.h",
938 ],
939 includes = ["tools/llvm-exegesis"],
940 deps = [
941 "//llvm:AllTargetsCodeGens",
942 "//llvm:AllTargetsDisassemblers",
943 "//llvm:CodeGen",
944 "//llvm:CodeGenTypes",
945 "//llvm:Exegesis",
946 "//llvm:MC",
947 "//llvm:MCDisassembler",
948 "//llvm:Support",
949 "//llvm:TargetParser",
950 "//llvm:TestingSupport",
951 "//llvm:X86CodeGen",
952 "//llvm:X86UtilsAndDesc",
953 "//third-party/unittest:gmock",
954 "//third-party/unittest:gtest",
955 "//third-party/unittest:gtest_main",
956 ],
957 )
958
959 cc_test(
960 name = "llvm_mca_tests",
961 size = "small",
962 srcs = glob(
963 [
964 "tools/llvm-mca/*.cpp",
965 "tools/llvm-mca/*.h",
966 "tools/llvm-mca/X86/*.cpp",
967 "tools/llvm-mca/X86/*.h",
968 ],
969 allow_empty = False,
970 ),
971 includes = ["tools/llvm-mca"],
972 deps = [
973 "//llvm:MC",
974 "//llvm:MCA",
975 "//llvm:MCAApplication",
976 "//llvm:Support",
977 "//llvm:TargetParser",
978 "//llvm:X86CodeGen",
979 "//llvm:X86UtilsAndDesc",
980 "//third-party/unittest:gtest",
981 "//third-party/unittest:gtest_main",
982 ],
983 )