-
Notifications
You must be signed in to change notification settings - Fork 14.3k
update_test_checks: recognize %if in RUN line #108972
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
@llvm/pr-subscribers-testing-tools Author: Elvina Yakubova (ElvinaYakubova) ChangesRecognize %if for target-specific cases in RUN line and keep only tool command with options Full diff: https://github.com/llvm/llvm-project/pull/108972.diff 1 Files Affected:
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index 16f3e618770b20..4bcc501f4d04a3 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -123,7 +123,13 @@ def main():
common.warn("Skipping unparsable RUN line: " + l)
continue
- commands = [cmd.strip() for cmd in l.split("|")]
+ cropped_content = l
+ if "%if" in l:
+ match = re.search(r'%{\s*(.*?)\s*%}', l)
+ if match:
+ cropped_content = match.group(1)
+
+ commands = [cmd.strip() for cmd in cropped_content.split("|")]
assert len(commands) >= 2
preprocess_cmd = None
if len(commands) > 2:
|
✅ With the latest revision this PR passed the Python code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case?
It would be good to move any of this parsing to common so that the other update scripts also benfit from this (cc_test_checks, llc_test_checks, mir_test_checks). I think the ideal solution would be to reuse lit code parse the RUN lines instead of re-implementing most of the syntax in these scripts. I started working on that a while ago but never got around to finishing it. |
Recognize %if for target-specific cases in RUN line and keep only tool command with options
60adcfd
to
cc128cc
Compare
added test case |
do you have an open PR or branch in your fork repo for that? |
gentle ping @RKSimon |
Recognize %if for target-specific cases in RUN line and keep only tool command with options