[clang] [clang] Forward `-fvalidate-ast-input-files-content` when loading an AST dump (PR #196298)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon May 11 04:50:43 PDT 2026
================
@@ -0,0 +1,42 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+
+// Step 1: Build PCH and defmap.
+// RUN: %clang_cc1 -x c -emit-pch -fvalidate-ast-input-files-content -o %t/other.c.ast %t/other.c
+// RUN: %clang_extdef_map %t/other.c -- -c -x c > %t/externalDefMap.tmp.txt
+// RUN: sed 's| .*other\.c| other.c.ast|' %t/externalDefMap.tmp.txt > %t/externalDefMap.txt
+
+// Step 2: Run CTU using the PCH - the division by zero is found via inlining.
+// RUN: %clang_cc1 -analyze \
+// RUN: -fvalidate-ast-input-files-content \
+// RUN: -analyzer-checker=core \
+// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
+// RUN: -analyzer-config ctu-dir=%t \
+// RUN: -verify %t/main.c
+
+// Step 3: Advance mtime of the source from which PCH was built.
+// RUN: %python -c "import os, sys, time; os.utime(sys.argv[1], (time.time() + 120, time.time() + 120))" %t/other.c
----------------
steakhal wrote:
The funny thing is that you added one similar `touch` about a month ago xD
https://github.com/llvm/llvm-project/commit/9560abb68aece7200fbb5e4da1bb7b7499663378#diff-67481ef3e92ddbd37dc0f8caa24c22a564ced8de3e1a274cb15cc97bbf65dfd8R5
https://github.com/llvm/llvm-project/pull/196298
More information about the cfe-commits
mailing list