Make utils/update_llc_test_checks.py note that the assertions are
[oota-llvm.git] / utils / update_llc_test_checks.py
index df01d8973c4641ec4401f0902c0e94902ababa87..cfdf830907f50b91f29016359ace28af40b35449 100755 (executable)
@@ -73,6 +73,8 @@ def main():
       flags=(re.M | re.S))
   check_prefix_re = re.compile('--check-prefix=(\S+)')
   check_re = re.compile(r'^\s*;\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL)?:')
+  autogenerated_note = ('; NOTE: Assertions have been autogenerated by '
+                        'utils/update_llc_test_checks.py')
 
   for test in args.tests:
     if args.verbose:
@@ -136,7 +138,7 @@ def main():
           if f in asm[prefix] and asm[prefix][f] != f_asm:
             if prefix == prefixes[-1]:
               print >>sys.stderr, ('WARNING: Found conflicting asm under the '
-                                   'same prefix!')
+                                   'same prefix: %r!' % (prefix,))
             else:
               asm[prefix][f] = None
               continue
@@ -149,6 +151,8 @@ def main():
     if args.verbose:
       print >>sys.stderr, 'Rewriting FileCheck prefixes: %s' % (prefix_set,)
     fixed_lines = []
+    fixed_lines.append(autogenerated_note)
+
     for l in test_lines:
       if is_in_function_start:
         if l.lstrip().startswith(';'):
@@ -191,6 +195,8 @@ def main():
           is_in_function = False
         continue
 
+      if l == autogenerated_note:
+        continue
       fixed_lines.append(l)
 
       m = ir_function_re.match(l)