xref: /llvm-project/clang/test/Modules/config-mismatch.cpp (revision a114c46e8735254e73c6177045fff26b37a77c93)
1*a114c46eSRichard Smith // RUN: rm -rf %t
2*a114c46eSRichard Smith // RUN: mkdir %t
3*a114c46eSRichard Smith // RUN: echo 'module M { header "foo.h" header "bar.h" }' > %t/map
4*a114c46eSRichard Smith // RUN: echo 'template<typename T> void f(T t) { int n; t.f(n); }' > %t/foo.h
5*a114c46eSRichard Smith // RUN: touch %t/bar.h
6*a114c46eSRichard Smith // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -x c++ %t/map -emit-module -fmodule-name=M -o %t/pcm
7*a114c46eSRichard Smith // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fmodule-map-file=%t/map -fmodule-file=%t/pcm -I%t %s -fsyntax-only -fexceptions -Wno-module-file-config-mismatch -verify
8*a114c46eSRichard Smith // RUN: rm %t/bar.h
9*a114c46eSRichard Smith // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fmodule-map-file=%t/map -fmodule-file=%t/pcm -I%t %s -fsyntax-only -fexceptions -Wno-module-file-config-mismatch -verify
10*a114c46eSRichard Smith #include "foo.h"
11*a114c46eSRichard Smith namespace n { // expected-note {{begins here}}
12*a114c46eSRichard Smith #include "foo.h" // expected-error {{redundant #include of module 'M' appears within namespace}}
13*a114c46eSRichard Smith }
14