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 likef2a3079a1bandada79f4c26easier. rdar://159857416 --------- Co-authored-by: Cyndy Ishida <cyndyishida@gmail.com>
13 lines
694 B
C
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
|