diff options
| author | Ben Langmuir <blangmuir@apple.com> | 2014-05-05 05:31:33 +0000 |
|---|---|---|
| committer | Ben Langmuir <blangmuir@apple.com> | 2014-05-05 05:31:33 +0000 |
| commit | 527040e0c87ac8d6cdde46be51c1a93e098bb5fd (patch) | |
| tree | afcff5e3af5543aff587f498b4c4ad5fdc6416de /clang/test/Modules/import-self.m | |
| parent | d29607871f661c9cde7f60fbf3adeae4fb6d82bc (diff) | |
| download | bcm5719-llvm-527040e0c87ac8d6cdde46be51c1a93e098bb5fd.tar.gz bcm5719-llvm-527040e0c87ac8d6cdde46be51c1a93e098bb5fd.zip | |
Make module self-import an error
Ideally, importing Foo.a from Foo.b would "do the right thing", but
until it does, this patch makes it an error rather than allow it to
silently be ignored.
llvm-svn: 207948
Diffstat (limited to 'clang/test/Modules/import-self.m')
| -rw-r--r-- | clang/test/Modules/import-self.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Modules/import-self.m b/clang/test/Modules/import-self.m new file mode 100644 index 00000000000..68be565eaf4 --- /dev/null +++ b/clang/test/Modules/import-self.m @@ -0,0 +1,11 @@ +// RUN: rm -rf %t +// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t \ +// RUN: -I %S/Inputs/submodules %s 2>&1 | FileCheck %s +// CHECK: import of module 'import_self.c' appears within same top-level module 'import_self' + +// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t \ +// RUN: -I %S/Inputs/submodules -fmodule-name=import_self %s \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-fmodule-name %s +// CHECK-fmodule-name: import of module 'import_self.b' appears within same top-level module 'import_self' + +@import import_self.b; |

