Files
carbon-lang/toolchain/lowering/BUILD
T
Jon Ross-PerkinsandChandler Carruth e4a04c2936 Use new test framework in toolchain to reduce per-test overhead (#2821)
This builds on #2814 by adding the test framework to the toolchain. On Linux, this is 7s -> 4s for me. #2811 has more detailed timing for the explorer, which also had more dramatic changes because it's about 3x more tests run in 2x as many ways (6x total).

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2023-05-12 10:40:22 -07:00

69 lines
1.7 KiB
Python

# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("//bazel/sh_run:rules.bzl", "glob_sh_run")
load("//testing/file_test:rules.bzl", "file_test")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "lower_to_llvm",
srcs = ["lower_to_llvm.cpp"],
hdrs = ["lower_to_llvm.h"],
deps = [
":lowering",
"//toolchain/semantics:semantics_ir",
"@llvm-project//llvm:Core",
"@llvm-project//llvm:Support",
],
)
cc_library(
name = "lowering",
srcs = ["lowering.cpp"],
hdrs = ["lowering.h"],
deps = [
"//common:check",
"//toolchain/semantics:semantics_ir",
"//toolchain/semantics:semantics_node",
"//toolchain/semantics:semantics_node_kind",
"@llvm-project//llvm:Core",
"@llvm-project//llvm:Support",
],
)
file_test(
name = "lowering_file_test",
srcs = ["lowering_file_test.cpp"],
tests = glob(["testdata/**/*.carbon"]),
deps = [
"//testing/file_test:file_test_base",
"//toolchain/driver",
"@com_google_googletest//:gtest",
"@llvm-project//llvm:Support",
],
)
glob_sh_run(
args = [
"$(location //toolchain/driver:carbon)",
"dump",
"llvm-ir",
],
data = ["//toolchain/driver:carbon"],
file_exts = ["carbon"],
)
glob_sh_run(
args = [
"$(location //toolchain/driver:carbon)",
"-v",
"dump",
"llvm-ir",
],
data = ["//toolchain/driver:carbon"],
file_exts = ["carbon"],
run_ext = "verbose",
)