summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-anon-namespace.cpp
diff options
context:
space:
mode:
authorEkaterina Romanova <katya_romanova@playstation.sony.com>2015-12-10 18:52:50 +0000
committerEkaterina Romanova <katya_romanova@playstation.sony.com>2015-12-10 18:52:50 +0000
commit9218a3bf04ef8f75937b07cae1df7e3c71c8c88f (patch)
treecb9f62ad766e91994bdd35d022af0688a3f22233 /clang/test/CodeGenCXX/debug-info-anon-namespace.cpp
parent923fdbadae3cda40ae3d3e3e977a5bd177866a0f (diff)
downloadbcm5719-llvm-9218a3bf04ef8f75937b07cae1df7e3c71c8c88f.tar.gz
bcm5719-llvm-9218a3bf04ef8f75937b07cae1df7e3c71c8c88f.zip
Do not generate DW_TAG_imported_module for anonymous namespaces (even nested) for all the platforms except PS4.
For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute. Differential Revision: http://reviews.llvm.org/D12624 llvm-svn: 255281
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-anon-namespace.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-anon-namespace.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-anon-namespace.cpp b/clang/test/CodeGenCXX/debug-info-anon-namespace.cpp
new file mode 100644
index 00000000000..4e3e08af2b7
--- /dev/null
+++ b/clang/test/CodeGenCXX/debug-info-anon-namespace.cpp
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-scei-ps4 -O0 %s -o - | FileCheck --check-prefix=PS4 %s
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-unknown-linux-gnu -O0 %s -o - | FileCheck --check-prefix=NON-PS4 %s
+
+namespace
+{
+ int a = 5;
+}
+int *b = &a;
+
+namespace
+{
+ namespace {
+ int a1 = 5;
+ }
+ int a2 = 7;
+}
+int *b1 = &a1;
+int *b2 = &a2;
+
+
+// PS4: [[NS:![0-9]+]] = !DINamespace
+// PS4: [[NS2:![0-9]+]] = !DINamespace
+// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: !0, entity: [[NS]])
+// PS4: !DIImportedEntity(tag: DW_TAG_imported_module, scope: [[NS]], entity: [[NS2]], line: {{[0-9]+}})
+// NON-PS4-NOT: !DIImportedEntity
+
OpenPOWER on IntegriCloud