[llvm] r323178 - update_mir_test_checks: Improve the check for LLVM IR in MIR files

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 22:39:05 PST 2018


Author: bogner
Date: Mon Jan 22 22:39:04 2018
New Revision: 323178

URL: http://llvm.org/viewvc/llvm-project?rev=323178&view=rev
Log:
update_mir_test_checks: Improve the check for LLVM IR in MIR files

The LLVM IR section of a MIR document can start with "--- |" rather
than just "---", because "|" is a sigil for a freeform document in
YAML. We need to handle this so that we don't try to add check lines
to the LLVM IR functions in a MIR file.

Modified:
    llvm/trunk/utils/update_mir_test_checks.py

Modified: llvm/trunk/utils/update_mir_test_checks.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/update_mir_test_checks.py?rev=323178&r1=323177&r2=323178&view=diff
==============================================================================
--- llvm/trunk/utils/update_mir_test_checks.py (original)
+++ llvm/trunk/utils/update_mir_test_checks.py Mon Jan 22 22:39:04 2018
@@ -360,7 +360,7 @@ def update_test_file(llc, test, remove_c
             if m:
                 state = 'ir function prefix'
                 func_name = m.group('func')
-            if input_line.strip() == '---':
+            if input_line.rstrip('| \r\n') == '---':
                 state = 'document'
             output_lines.append(input_line)
         elif state == 'document':




More information about the llvm-commits mailing list