From 2d5a9cacc2e82a4587dc960432f6c5fffe466371 Mon Sep 17 00:00:00 2001 From: Slava Zakharin Date: Tue, 2 Sep 2025 14:49:08 -0700 Subject: [PATCH] [utils] Process attribute references in lines defining attrs. Here is an example of TBAA attributes generated by Flang: ``` ``` We have to process the test after `=` to replace the attribute references with proper check variables. --- mlir/utils/generate-test-checks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py index 14a790e6d0e6e..f80a1811f418c 100755 --- a/mlir/utils/generate-test-checks.py +++ b/mlir/utils/generate-test-checks.py @@ -229,7 +229,9 @@ def process_attribute_definition(line, attribute_namer): "// CHECK: #[[" + attribute_name + ":.+]] =" - + line[len(m.group(0)) :] + # The rest of the line may contain attribute references, + # so we have to process them. + + process_attribute_references(line[len(m.group(0)) :], attribute_namer) + "\n" ) return None