Skip to content

[lit][NFC] Avoid unintended -EMPTY suffix in check prefix #99690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Jul 19, 2024

FileCheck has special handline for the -EMPTY suffix, that should
match empty lines. Overloading the suffix can be a source of confusion
when reading tests. Additionally, the current implementation seems to
match the following expressions, which appears to be a bug in FileCheck.

Created using spr 1.3.4
@llvmbot
Copy link
Member

llvmbot commented Jul 19, 2024

@llvm/pr-subscribers-testing-tools

Author: Paul Kirth (ilovepi)

Changes

FileCheck has special handline for the -EMPTY suffix, that should
match empty lines. Overloading the suffix can be a source of confusion
when reading tests. Additionally, the current implementation seems to
match the following expressions, which appears to be a bug in FileCheck.


Full diff: https://github.com/llvm/llvm-project/pull/99690.diff

1 Files Affected:

  • (modified) llvm/utils/lit/tests/Inputs/shtest-env/env-calls-env.txt (+3-3)
diff --git a/llvm/utils/lit/tests/Inputs/shtest-env/env-calls-env.txt b/llvm/utils/lit/tests/Inputs/shtest-env/env-calls-env.txt
index e4997b1250ed3..26150c413dc03 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-env/env-calls-env.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-env/env-calls-env.txt
@@ -1,10 +1,10 @@
 # Check that internal env can call internal env.
 
 # RUN: env env %{python} print_environment.py \
-# RUN: | FileCheck -check-prefix=CHECK-2-EMPTY %s
+# RUN: | FileCheck -check-prefix=CHECK-2-EMPTY-ARGS %s
 #
-# CHECK-2-EMPTY: BAR = 2
-# CHECK-2-EMPTY: FOO = 1
+# CHECK-2-EMPTY-ARGS: BAR = 2
+# CHECK-2-EMPTY-ARGS: FOO = 1
 
 # RUN: env FOO=2 env BAR=1 %{python} print_environment.py \
 # RUN: | FileCheck -check-prefix=CHECK-2-VAL %s

@ilovepi ilovepi requested a review from jh7370 July 19, 2024 19:39
@ilovepi
Copy link
Contributor Author

ilovepi commented Jul 19, 2024

CC: @Harini0924

Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ilovepi ilovepi merged commit 5ea38b8 into main Jul 22, 2024
10 checks passed
@ilovepi ilovepi deleted the users/ilovepi/spr/litnfc-avoid-unintended-empty-suffix-in-check-prefix branch July 22, 2024 15:21
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
FileCheck has special handline for the `-EMPTY` suffix, that should
match empty lines. Overloading the suffix can be a source of confusion
when reading tests. Additionally, the current implementation seems to
match the following expressions, which appears to be a bug in FileCheck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants