Skip to content

[FileCheck][Docs] Fix regex for FileCheck variable names #97301

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

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

AntonLydike
Copy link
Contributor

This fixes a minor oversight in the FileCheck documentation on what is considered a valid variable name.

Global variables are prefixed with a $, which is explained two paragraphs below, but this was omitted in the presented regex in this paragraph.

@llvmbot
Copy link
Member

llvmbot commented Jul 1, 2024

@llvm/pr-subscribers-testing-tools

Author: Anton Lydike (AntonLydike)

Changes

This fixes a minor oversight in the FileCheck documentation on what is considered a valid variable name.

Global variables are prefixed with a $, which is explained two paragraphs below, but this was omitted in the presented regex in this paragraph.


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

1 Files Affected:

  • (modified) llvm/docs/CommandGuide/FileCheck.rst (+1-1)
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index 432dafa100bfd..af4930409da1a 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -731,7 +731,7 @@ The first check line matches a regex ``%[a-z]+`` and captures it into the
 string variable ``REGISTER``.  The second line verifies that whatever is in
 ``REGISTER`` occurs later in the file after an "``andw``". :program:`FileCheck`
 string substitution blocks are always contained in ``[[ ]]`` pairs, and string
-variable names can be formed with the regex ``[a-zA-Z_][a-zA-Z0-9_]*``.  If a
+variable names can be formed with the regex ``\$[a-zA-Z_][a-zA-Z0-9_]*``.  If a
 colon follows the name, then it is a definition of the variable; otherwise, it
 is a substitution.
 

Copy link
Contributor

@RoboTux RoboTux left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@AntonLydike
Copy link
Contributor Author

@RoboTux sorry, new to all of this, the windows build failure seems not related to this change, can I just merge or should I rebase and re-run CI?

@jh7370
Copy link
Collaborator

jh7370 commented Jul 2, 2024

@RoboTux sorry, new to all of this, the windows build failure seems not related to this change, can I just merge or should I rebase and re-run CI?

You can merge. Keep an eye out for buildbot notifications.

@AntonLydike AntonLydike merged commit 6ad82fc into llvm:main Jul 2, 2024
8 of 10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 2, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-fuzzer running on sanitizer-buildbot12 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/159/builds/1226

Here is the relevant piece of the build log for the reference:

Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...


Not searching for unused variables given on the command line.
-- Building with -fPIC
-- LLVM host triple: aarch64-unknown-linux-gnu
-- LLVM default target triple: aarch64-unknown-linux-gnu
-- Using libunwind testing configuration: /b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/libunwind/test/configs/llvm-libunwind-shared.cfg.in
-- Failed to locate sphinx-build executable (missing: SPHINX_EXECUTABLE) 
-- Using libc++abi testing configuration: /b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/libcxxabi/test/configs/llvm-libc++abi-shared.cfg.in
-- Using libc++ testing configuration: /b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/libcxx/test/configs/llvm-libc++-shared.cfg.in
-- Clang-tidy tests are disabled since the Clang development package has no clangTidy target.
-- ABI list file not generated for configuration aarch64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew, `check-cxx-abilist` will not be available.
CMake Deprecation Warning at /b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0114 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/compiler-rt/CMakeLists.txt:12 (include)


-- Compiler-RT supported architectures: aarch64
-- Generated Sanitizer SUPPORTED_TOOLS list on "Linux" is "asan;lsan;hwasan;msan;tsan;ubsan"
-- sanitizer_common tests on "Linux" will run against "asan;lsan;hwasan;msan;tsan;ubsan"
-- Configuring done (2.2s)
-- Generating done (0.6s)
-- Build files have been written to: /b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/runtimes/runtimes-bins
[12/15] Performing build step for 'runtimes'
[0/7] Performing build step for 'libcxx_fuzzer_aarch64'
ninja: no work to do.
[3/7] Building CXX object compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic_version_script_dummy.aarch64.dir/dummy.cpp.o
[5/7] Linking CXX shared library /b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/19/lib/aarch64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
[6/7] Linking CXX shared library /b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/19/lib/aarch64-unknown-linux-gnu/libclang_rt.hwasan.so
[7/7] Linking CXX shared library /b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/lib/clang/19/lib/aarch64-unknown-linux-gnu/libclang_rt.asan.so
[13/15] No install step for 'runtimes'
[15/15] Completed 'runtimes'
+ md5sum llvm_build0/bin/clang
306a17466bdf3bb70014791608820bce  llvm_build0/bin/clang
++ readlink -f llvm_build0/bin
+ export PATH=/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
+ PATH=/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
+ echo @@@BUILD_STEP get fuzzer-test-suite @@@
+ '[' '!' -e fuzzer-test-suite ']'
@@@BUILD_STEP get fuzzer-test-suite @@@
+ cd fuzzer-test-suite
+ git pull
fatal: unable to access 'https://github.com/google/fuzzer-test-suite.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Step 8 (get fuzzer-test-suite) failure: get fuzzer-test-suite (failure)
@@@BUILD_STEP get fuzzer-test-suite @@@
+ cd fuzzer-test-suite
+ git pull
fatal: unable to access 'https://github.com/google/fuzzer-test-suite.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
program finished with exit code 1
elapsedTime=48.021142

lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
This fixes a minor oversight in the FileCheck documentation on what is
considered a valid variable name.

Global variables are prefixed with a `$`, which is explained two
paragraphs below, but this was omitted in the presented regex in this
paragraph.
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
This fixes a minor oversight in the FileCheck documentation on what is
considered a valid variable name.

Global variables are prefixed with a `$`, which is explained two
paragraphs below, but this was omitted in the presented regex in this
paragraph.
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.

5 participants