diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-08 01:13:22 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-08 01:13:22 +0000 |
commit | 7c2d0241bcc214ce9931d2ca51a3122872897a5b (patch) | |
tree | 9b67c676a785f7e557d4d24a6b9ebf883b492cc3 /test | |
parent | 24ba25c65117aa52944d8589254d27a52cf0face (diff) | |
download | clang-7c2d0241bcc214ce9931d2ca51a3122872897a5b.tar.gz |
Fix pr18174.
Clang outputs LLVM one top level decl at a time. This combined with the
visibility computation code looking for the newest NamespaceDecl would cause
it to produce different results for nested namespaces.
The two options for producing consistent results are
* Delay codegen of anything inside a namespace until the end of the file.
* Don't look for the newest NamespaceDecl.
This patch implements the second option.
This matches the gcc behavior too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGenCXX/visibility.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp index 6049bf8d2b..1c4d5bb8e7 100644 --- a/test/CodeGenCXX/visibility.cpp +++ b/test/CodeGenCXX/visibility.cpp @@ -1295,3 +1295,17 @@ namespace test68 { } // Check lines at top of file. } + +namespace test69 { + // PR18174 + namespace foo { + void f(); + } + namespace foo { + void f() {}; + } + namespace foo __attribute__((visibility("hidden"))) { + } + // CHECK-LABEL: define void @_ZN6test693foo1fEv + // CHECK-HIDDEN-LABEL: define hidden void @_ZN6test693foo1fEv +} |