xref: /llvm-project/clang/test/Modules/module-file-modified.c (revision c8c9415644fa2cce5b65d8ea005e62ac59a73708)
1*c8c94156SManman Ren // RUN: rm -rf %t
2*c8c94156SManman Ren // RUN: mkdir %t
3*c8c94156SManman Ren // RUN: echo 'int foo = 0;' > %t/a.h
4*c8c94156SManman Ren // RUN: echo 'module A { header "a.h" }' > %t/m.modulemap
5*c8c94156SManman Ren // RUN: %clang_cc1 -fmodules -emit-module -fmodule-name=A -x c %t/m.modulemap -o %t/m.pcm
6*c8c94156SManman Ren // RUN: echo 'int bar;' > %t/a.h
7*c8c94156SManman Ren // 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
8*c8c94156SManman Ren #include "a.h"
9*c8c94156SManman Ren int foo = 0; // redefinition of 'foo'
10*c8c94156SManman Ren // CHECK: fatal error: file {{.*}} has been modified since the module file {{.*}} was built
11*c8c94156SManman Ren // REQUIRES: shell
12