From: Alex Richardson Date: Thu, 31 Oct 2019 21:18:32 +0000 (+0000) Subject: [update_cc_test_checks.py] Pass the builtin include dir to clang X-Git-Tag: llvmorg-11-init~5310 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9cc7d14085a9c7d3f04380d974160be759a09eb;p=platform%2Fupstream%2Fllvm.git [update_cc_test_checks.py] Pass the builtin include dir to clang Summary: This is required to update tests that make use of builtin headers. To fix this use the same command expansion as lit does for %clang_cc1. I tested this by updating clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c. %clang_cc1 will now expand to `clang -cc1 -internal-isystem $LLVM_BUILD/lib/clang/$VERSION/include -nostdsysteminc`. Reviewers: MaskRay Reviewed By: MaskRay Subscribers: kristof.beyls, dmgreen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69611 --- diff --git a/llvm/utils/update_cc_test_checks.py b/llvm/utils/update_cc_test_checks.py index 14d5cc3..2e1a190 100755 --- a/llvm/utils/update_cc_test_checks.py +++ b/llvm/utils/update_cc_test_checks.py @@ -117,6 +117,18 @@ def config(): print('Please specify --llvm-bin or --clang', file=sys.stderr) sys.exit(1) + # Determine the builtin includes directory so that we can update tests that + # depend on the builtin headers. See get_clang_builtin_include_dir() and + # use_clang() in llvm/utils/lit/lit/llvm/config.py. + try: + builtin_include_dir = subprocess.check_output( + [args.clang, '-print-file-name=include']).decode().strip() + SUBST['%clang_cc1'] = ['-cc1', '-internal-isystem', builtin_include_dir, + '-nostdsysteminc'] + except subprocess.CalledProcessError: + common.warn('Could not determine clang builtins directory, some tests ' + 'might not update correctly.') + if args.opt is None: if args.llvm_bin is None: args.opt = 'opt'