From 9f3f76a6b443ace47b564d79192ca176de4dd236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 4 Oct 2024 16:31:42 +0200 Subject: update_test_checks: collect original check lines for old versions of lit tests (#111148) Old versions of UTC produced function labels like: ; CHECK-LABEL: @func( Fix the regular expression used when scanning for old check lines to recognize this form of label. This allows meta variable stability to apply when running UTC on tests using this form of label. Reported-by: Nikita Popov --- llvm/utils/UpdateTestChecks/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/utils/UpdateTestChecks/common.py') diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 759fc5d..8ed600e 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -454,7 +454,7 @@ def collect_original_check_lines(ti: TestInfo, prefix_set: set): continue if check_kind == "LABEL": - m = IR_FUNCTION_RE.match(line) + m = IR_FUNCTION_LABEL_RE.match(line) if m is not None: func_name = m.group(1) if ( @@ -572,6 +572,9 @@ LOOP_PASS_DEBUG_RE = re.compile( ) IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@"?([\w.$-]+)"?\s*\(') +IR_FUNCTION_LABEL_RE = re.compile( + r'^\s*(?:define\s+(?:internal\s+)?[^@]*)?@"?([\w.$-]+)"?\s*\(' +) TRIPLE_IR_RE = re.compile(r'^\s*target\s+triple\s*=\s*"([^"]+)"$') TRIPLE_ARG_RE = re.compile(r"-m?triple[= ]([^ ]+)") MARCH_ARG_RE = re.compile(r"-march[= ]([^ ]+)") -- cgit v1.1