aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-09 02:00:10 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-09 02:00:10 +0000
commitbafdcc655d4f742a9b3c203e38c3d4075dcb5a28 (patch)
tree9049bf20c7ce63bdc9b9b92b05bf6f4ce186870f /clang/test
parent7f06b279900eb14848dd23438abf296d136fae59 (diff)
downloadllvm-bafdcc655d4f742a9b3c203e38c3d4075dcb5a28.zip
llvm-bafdcc655d4f742a9b3c203e38c3d4075dcb5a28.tar.gz
llvm-bafdcc655d4f742a9b3c203e38c3d4075dcb5a28.tar.bz2
Merging r196712:
------------------------------------------------------------------------ r196712 | rafael | 2013-12-07 17:13:22 -0800 (Sat, 07 Dec 2013) | 12 lines 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. ------------------------------------------------------------------------ llvm-svn: 196745
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/visibility.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp
index 6049bf8..1c4d5bb 100644
--- a/clang/test/CodeGenCXX/visibility.cpp
+++ b/clang/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
+}