Files
llvm-project/clang/test/Modules/module-file-modified.c
Volodymyr Sapsai c7c95c29f3 [modules] Add diagnostic about performed input file validation when encounter unrecoverable changed input file. (#180899)
The expected behavior for implicitly built modules is to validate input
files and to rebuild a module if there are any input file changes. But
if for some reason a module hasn't been rebuilt, it is useful to know if
the validation has been done and what kind of validation.

The goal is to make investigations for fixes like
f2a3079a1b and
ada79f4c26 easier.

rdar://159857416

---------

Co-authored-by: Cyndy Ishida <cyndyishida@gmail.com>
2026-02-18 18:40:46 -08:00

13 lines
694 B
C

// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo 'int foo = 0;' > %t/a.h
// RUN: echo 'module A { header "a.h" }' > %t/m.modulemap
// RUN: %clang_cc1 -fmodules -emit-module -fmodule-name=A -x c %t/m.modulemap -o %t/m.pcm
// RUN: echo 'int bar;' > %t/a.h
// RUN: not %clang_cc1 -fmodules -fmodule-file=%t/m.pcm -fmodule-map-file=%t/m.modulemap -x c %s -I%t -fsyntax-only 2>&1 | FileCheck %s
#include "a.h"
int foo = 0; // redefinition of 'foo'
// CHECK: fatal error: file {{.*}} has been modified since the module file {{.*}} was built
// CHECK: note: precompiled file '{{.*}}m.pcm' needs to be rebuilt
// CHECK: note: earlier input file validation was disabled for this kind of precompiled file