Debian Codegraph @

clang/test/Modules/validate-file-content.m

raw
1 // Check driver works
2 // RUN: %clang -fmodules -fsyntax-only -fmodules-validate-input-files-content %s -### 2>&1 | FileCheck --check-prefix=CHECK-CC1 %s
3 // CHECK-CC1: -fvalidate-ast-input-files-content
4 //
5 // PCH+Modules: Test that a mtime mismatch without content change is fine
6 // RUN: rm -rf %t
7 // RUN: mkdir %t
8 // RUN: echo '// m.h' > %t/m.h
9 // RUN: echo '#include "m.h"' > %t/a.h
10 // RUN: echo 'module m { header "m.h" }' > %t/module.modulemap
11 // RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -o %t/a.pch -I %t -x objective-c-header %t/a.h -fvalidate-ast-input-files-content
12 // RUN: touch -m -a -t 202901010000 %t/m.h
13 // RUN: %clang_cc1 -fsyntax-only -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t -include-pch %t/a.pch %s -verify -fvalidate-ast-input-files-content
14 //
15 // PCH+Modules: Test that a mtime mismatch with content change
16 // RUN: rm -rf %t
17 // RUN: mkdir %t
18 // RUN: echo '// m.h' > %t/m.h
19 // RUN: echo '#include "m.h"' > %t/a.h
20 // RUN: echo 'module m { header "m.h" }' > %t/module.modulemap
21 // RUN: %clang_cc1 -emit-pch -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -o %t/a.pch -I %t -x objective-c-header %t/a.h -fvalidate-ast-input-files-content
22 // RUN: echo '// m.x' > %t/m.h
23 // RUN: touch -m -a -t 202901010000 %t/m.h
24 // RUN: not %clang_cc1 -fsyntax-only -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t -include-pch %t/a.pch %s -fvalidate-ast-input-files-content 2> %t/stderr
25 // RUN: FileCheck %s < %t/stderr
26 //
27 // CHECK: file '[[M_H:.*[/\\]m\.h]]' has been modified since the precompiled header '[[A_PCH:.*/a\.pch]]' was built: content changed
28 // CHECK: '[[M_H]]' required by '[[M_PCM:.*[/\\]m.*\.pcm]]'
29 // CHECK: '[[M_PCM]]' required by '[[A_PCH]]'
30 // CHECK: please rebuild precompiled file '[[A_PCH]]'
31 // expected-no-diagnostics