Files
TheRock/compiler/amd-llvm/llvm/utils/lit/tests/Inputs/shtest-define/lit.cfg
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

57 lines
2.8 KiB
INI

import lit.formats
config.name = "shtest-define"
config.suffixes = [".txt"]
# Use lit's internal shell to avoid shell portability issues within RUN lines
# (e.g., for 'echo' commands in Windows). Those issues should be orthogonal to
# the substitution behavior we are trying to test.
config.test_format = lit.formats.ShTest(execute_external=False)
config.test_source_root = None
config.test_exec_root = None
# When config.recursiveExpansionLimit is not specified, it's important to
# prepend substitutions before substitutions they might now or later (upon a
# redefinition) depend upon. For example, %{global:greeting} and %{global:what}
# act as parameters for %{global:echo}, so we make sure the latter expands
# before the former. Moreover, some tests redefine %{global:greeting} in terms
# of %{global:what}, so we make sure the former expands before the latter.
# If we always insert at the beginning of the substitution list (as DEFINE
# does), then the rule is simple: define a substitution before you refer to it.
config.substitutions.insert(0, ("%{global:what}", "World"))
config.substitutions.insert(0, ("%{global:greeting}", ""))
config.substitutions.insert(
0, ("%{global:echo}", "echo GLOBAL: %{global:greeting} %{global:what}")
)
# This substitution includes an re.sub replacement string escape sequence,
# which lit should treat as plain text.
config.substitutions.insert(0, ("%{global:subst-with-escapes}", r"value-with-\g"))
# The following substitution definitions are confusing and should be avoided.
# We define them here so we can test that 'DEFINE:' and 'REDEFINE:' directives
# guard against the confusion they cause.
# Even though each of '%{global:inside}', '%{global:prefix}', and
# '%{global:suffix}' is not already the exact pattern of a substitution,
# 'DEFINE:' and 'REDEFINE:' will refuse to (re)define a substitution with that
# pattern because it is a substring of one of the following substitution's
# patterns.
config.substitutions.insert(0, ("<%{global:inside}>", "<@>"))
config.substitutions.insert(0, (r"%{global:prefix}\((.*)\)", r"@(\g<1>)"))
config.substitutions.insert(0, ("@%{global:suffix}", "@@"))
# These cannot be redefined by 'REDEFINE:', which doesn't know which one to
# redefine.
config.substitutions.insert(0, ("%{global:multiple-exact}", "first"))
config.substitutions.insert(0, ("%{global:multiple-exact}", "second"))
# Even though '%{global:multiple-once-exact}' is the exact pattern of only one
# existing substitution, 'REDEFINE:' will refuse to redefine that substitution
# because that string is a substring of another substitution's pattern.
config.substitutions.insert(0, ("%{global:multiple-once-exact}", "@"))
config.substitutions.insert(0, ("<%{global:multiple-once-exact}>", "<@>"))
recur = lit_config.params.get("recur", None)
if recur:
config.recursiveExpansionLimit = int(recur)