[PATCH] D68230: [UpdateCCTestChecks] Allow asm in output with --allow-asm
David Greene via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 07:20:50 PDT 2019
greened updated this revision to Diff 222605.
greened added a comment.
We also need to use the asm check generator so that LABEL expressions are generated correctly.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68230/new/
https://reviews.llvm.org/D68230
Files:
llvm/utils/update_cc_test_checks.py
Index: llvm/utils/update_cc_test_checks.py
===================================================================
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -88,6 +88,8 @@
help='Use more regex for x86 matching to reduce diffs between various subtargets')
parser.add_argument('-u', '--update-only', action='store_true',
help='Only update test if it was already autogened')
+ parser.add_argument('--allow-asm', action='store_true',
+ help='Accept machine asm in test checks')
parser.add_argument('tests', nargs='+')
args = parser.parse_args()
args.clang_args = shlex.split(args.clang_args or '')
@@ -120,6 +122,16 @@
common.build_function_body_dictionary(
common.OPT_FUNCTION_RE, common.scrub_body, [],
raw_tool_output, prefixes, func_dict, args.verbose)
+ elif args.allow_asm:
+ triple = triple_in_cmd
+ if not triple:
+ march_in_cmd = None
+ m = common.MARCH_ARG_RE.search('{}'.format(clang_args))
+ if m:
+ march_in_cmd = m.groups()[0]
+ triple = asm.get_triple_from_march(march_in_cmd)
+ asm.build_function_body_dictionary_for_triple(args, raw_tool_output,
+ triple, prefixes, func_dict)
else:
print('The clang command line should include -emit-llvm as asm tests '
'are discouraged in Clang testsuite.', file=sys.stderr)
@@ -240,7 +252,10 @@
if added:
output_lines.append('//')
added.add(mangled)
- common.add_ir_checks(output_lines, '//', run_list, func_dict, mangled)
+ if '-emit-llvm' in clang_args:
+ common.add_ir_checks(output_lines, '//', run_list, func_dict, mangled)
+ else:
+ asm.add_asm_checks(output_lines, '//', run_list, func_dict, mangled)
output_lines.append(line.rstrip('\n'))
# Update the test file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68230.222605.patch
Type: text/x-patch
Size: 1971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191001/cd359639/attachment.bin>
More information about the llvm-commits
mailing list