[PATCH] D68230: [UpdateCCTestChecks] Allow asm in output with --allow-asm
David Greene via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 30 09:30:19 PDT 2019
greened created this revision.
greened added reviewers: xbolva00, MaskRay.
greened added projects: LLVM, clang.
Herald added a subscriber: llvm-commits.
It is useful to have update_cc_test_checks.py generate asm checks for end-to-end testing. Add --allow-asm to generate test checks even if --emit-llvm doesn't appear on the clang command line.
Repository:
rG LLVM Github Monorepo
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68230.222450.patch
Type: text/x-patch
Size: 1460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190930/60fb7e43/attachment.bin>
More information about the llvm-commits
mailing list