[PATCH] D69611: [update_cc_test_checks.py] Pass the builtin include dir to clang

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 02:12:34 PDT 2019


arichardson created this revision.
arichardson added a reviewer: MaskRay.
Herald added subscribers: llvm-commits, dmgreen, kristof.beyls.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69611

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
@@ -119,6 +119,18 @@
     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'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69611.227050.patch
Type: text/x-patch
Size: 1007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191030/0122a20b/attachment.bin>


More information about the llvm-commits mailing list