diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-26 21:33:35 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-26 21:33:35 +0000 |
| commit | e5edbf9a16f3c91eae3aee58d78f6dc632ae0372 (patch) | |
| tree | 6d4353da0d642e89b6d266f721737976c660588d /clang/test/Modules | |
| parent | 24ec769058dcb5ae86c3edfa4b8dee787d888763 (diff) | |
| download | bcm5719-llvm-e5edbf9a16f3c91eae3aee58d78f6dc632ae0372.tar.gz bcm5719-llvm-e5edbf9a16f3c91eae3aee58d78f6dc632ae0372.zip | |
[Modules] Fix an issue where the reconstructed redeclaration chain was incomplete, missing the definition from a module.
-Make sure that a deserialized external decl gets added to the TU scope.
-When associating an identifier with a set of decls, use the most recent local ones,
if they exist, otherwise associating decls from modules (that came after a local one)
will lead to an incomplete reconstructed re-declaration chain.
rdar://13712705
llvm-svn: 180634
Diffstat (limited to 'clang/test/Modules')
| -rw-r--r-- | clang/test/Modules/redecls/a.h | 3 | ||||
| -rw-r--r-- | clang/test/Modules/redecls/b.h | 1 | ||||
| -rw-r--r-- | clang/test/Modules/redecls/main.m | 27 | ||||
| -rw-r--r-- | clang/test/Modules/redecls/module.map | 2 |
4 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/Modules/redecls/a.h b/clang/test/Modules/redecls/a.h new file mode 100644 index 00000000000..1647f86606a --- /dev/null +++ b/clang/test/Modules/redecls/a.h @@ -0,0 +1,3 @@ +@interface AA +@end +@class AA; diff --git a/clang/test/Modules/redecls/b.h b/clang/test/Modules/redecls/b.h new file mode 100644 index 00000000000..d41573ddc78 --- /dev/null +++ b/clang/test/Modules/redecls/b.h @@ -0,0 +1 @@ +@class AA; diff --git a/clang/test/Modules/redecls/main.m b/clang/test/Modules/redecls/main.m new file mode 100644 index 00000000000..9ec02b03f2c --- /dev/null +++ b/clang/test/Modules/redecls/main.m @@ -0,0 +1,27 @@ +// RUN: rm -rf %t.mcp +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=a %S/module.map -fmodules-cache-path=%t.mcp +// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=b %S/module.map -fmodules-cache-path=%t.mcp +// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t1.pch -fmodules-cache-path=%t.mcp +// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t2.pch -include-pch %t1.pch -fmodules-cache-path=%t.mcp +// RUN: %clang_cc1 -fmodules %s -fsyntax-only -include-pch %t2.pch -fmodules-cache-path=%t.mcp -verify + +#ifndef HEADER1 +#define HEADER1 + +@import a; + +#elif !defined(HEADER2) +#define HEADER2 + +@class AA; +@import b; + +#else + +// rdar://13712705 +@interface SS : AA +@end + +#warning parsed this +#endif +// expected-warning@-2{{parsed this}} diff --git a/clang/test/Modules/redecls/module.map b/clang/test/Modules/redecls/module.map new file mode 100644 index 00000000000..a36568207b6 --- /dev/null +++ b/clang/test/Modules/redecls/module.map @@ -0,0 +1,2 @@ +module a { header "a.h" } +module b { header "b.h" } |

