summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/lsv-debuginfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-10-24 00:06:02 +0000
committerAdrian Prantl <aprantl@apple.com>2018-10-24 00:06:02 +0000
commitba6fdc57b4be3d65903531a7ad734ccf417cb0a6 (patch)
treee7c205b4fa1d41d6d96ef4e667547ff0646464fb /clang/test/Modules/lsv-debuginfo.cpp
parentcd416382927996eb1aa661e3f9cf9ce3c46bb71e (diff)
downloadbcm5719-llvm-ba6fdc57b4be3d65903531a7ad734ccf417cb0a6.tar.gz
bcm5719-llvm-ba6fdc57b4be3d65903531a7ad734ccf417cb0a6.zip
Debug Info (-gmodules): emit full types for non-anchored template specializations
Before this patch, clang would emit a (module-)forward declaration for template instantiations that are not anchored by an explicit template instantiation, but still are guaranteed to be available in an imported module. Unfortunately detecting the owning module doesn't reliably work when local submodule visibility is enabled and the template is inside a cross-module namespace. This make clang debuggable again with -gmodules and LSV enabled. rdar://problem/41552377 llvm-svn: 345109
Diffstat (limited to 'clang/test/Modules/lsv-debuginfo.cpp')
-rwxr-xr-xclang/test/Modules/lsv-debuginfo.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/clang/test/Modules/lsv-debuginfo.cpp b/clang/test/Modules/lsv-debuginfo.cpp
new file mode 100755
index 00000000000..4a2644f6b31
--- /dev/null
+++ b/clang/test/Modules/lsv-debuginfo.cpp
@@ -0,0 +1,39 @@
+// Test C++ -gmodules debug info in the PCMs with local submodule visibility.
+// REQUIRES: asserts
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -triple %itanium_abi_triple \
+// RUN: -fmodules-local-submodule-visibility %s \
+// RUN: -dwarf-ext-refs -fmodule-format=obj -debug-info-kind=standalone \
+// RUN: -dwarf-version=4 -fmodules -fimplicit-module-maps \
+// RUN: -fmodules-cache-path="%t" -o %t.ll -I%S/Inputs/lsv-debuginfo \
+// RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll
+// RUN: cat %t-mod.ll | FileCheck %s
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -triple %itanium_abi_triple \
+// RUN: -fmodules-local-submodule-visibility %s \
+// RUN: -dwarf-ext-refs -fmodule-format=obj -debug-info-kind=standalone \
+// RUN: -dwarf-version=4 -fmodules -fimplicit-module-maps \
+// RUN: -fmodules-cache-path="%t" -o %t.ll -I%S/Inputs/lsv-debuginfo \
+// RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll \
+// RUN: -DWITH_NAMESPACE
+// RUN: cat %t-mod.ll | FileCheck %s
+
+// ADT
+// CHECK: @__clang_ast =
+
+// B
+// CHECK: @__clang_ast =
+
+// This type isn't anchored anywhere, expect a full definition.
+// CHECK: !DICompositeType({{.*}}, name: "AlignedCharArray<4, 16>",
+// CHECK-SAME: elements:
+
+// C
+// CHECK: @__clang_ast =
+
+// Here, too.
+// CHECK: !DICompositeType({{.*}}, name: "AlignedCharArray<4, 16>",
+// CHECK-SAME: elements:
+
+#include <B/B.h>
OpenPOWER on IntegriCloud