diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-05-20 13:49:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-05-20 13:49:41 +0000 |
commit | f4e76b864f772fb2792e89a83e29c5ee340d58f4 (patch) | |
tree | 68c1cae0560735184b3f06245c648b9e61a564b1 /clang/test/Modules | |
parent | 9711b25d4ba545f6deb7a285c40b1fc8669f4fd5 (diff) | |
download | bcm5719-llvm-f4e76b864f772fb2792e89a83e29c5ee340d58f4.tar.gz bcm5719-llvm-f4e76b864f772fb2792e89a83e29c5ee340d58f4.zip |
Add -Wincomplete-module, which detects when a header is included from a module but isn't itself part of a module.
llvm-svn: 182263
Diffstat (limited to 'clang/test/Modules')
-rw-r--r-- | clang/test/Modules/Inputs/incomplete_mod.h | 1 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/incomplete_mod_missing.h | 2 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/module.map | 4 | ||||
-rw-r--r-- | clang/test/Modules/incomplete-module.m | 5 |
4 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/incomplete_mod.h b/clang/test/Modules/Inputs/incomplete_mod.h new file mode 100644 index 00000000000..f08be724413 --- /dev/null +++ b/clang/test/Modules/Inputs/incomplete_mod.h @@ -0,0 +1 @@ +#include "incomplete_mod_missing.h" diff --git a/clang/test/Modules/Inputs/incomplete_mod_missing.h b/clang/test/Modules/Inputs/incomplete_mod_missing.h new file mode 100644 index 00000000000..ffc85d5e730 --- /dev/null +++ b/clang/test/Modules/Inputs/incomplete_mod_missing.h @@ -0,0 +1,2 @@ +extern int *missing; + diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map index d20521f9c76..249700a494a 100644 --- a/clang/test/Modules/Inputs/module.map +++ b/clang/test/Modules/Inputs/module.map @@ -209,3 +209,7 @@ module linkage_merge { } } + +module incomplete_mod { + header "incomplete_mod.h" +} diff --git a/clang/test/Modules/incomplete-module.m b/clang/test/Modules/incomplete-module.m new file mode 100644 index 00000000000..8edaea983cb --- /dev/null +++ b/clang/test/Modules/incomplete-module.m @@ -0,0 +1,5 @@ +@import incomplete_mod; + +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -Wincomplete-module -fmodules -I %S/Inputs %s 2>&1 | FileCheck %s +// CHECK: {{warning: header '.*incomplete_mod_missing.h' is included in module 'incomplete_mod' but not listed in module map}} |