+++ /dev/null
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -debug-info-kind=line-tables-only -S -emit-llvm -std=c++11 -o - %s | FileCheck --check-prefix LINUX %s
-// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=line-tables-only -gcodeview -S -emit-llvm -std=c++11 -o - %s | FileCheck --check-prefix MSVC %s
-
-// Check that we emit type information for function scopes in line tables for
-// CodeView.
-
-namespace A {
-void f() {}
-
-struct S {
- static void m() {}
-};
-}
-
-int main() {
- A::f();
- A::S::m();
- return 0;
- // MSVC: !{{[0-9]+}} = distinct !DISubprogram(name: "f"
- // MSVC-SAME: scope: [[SCOPE1:![0-9]+]]
- // MSVC-SAME: )
- // MSVC: [[SCOPE1]] = !DINamespace(name: "A", {{.*}})
- // MSVC: !{{[0-9]+}} = distinct !DISubprogram(name: "m"
- // MSVC-SAME: scope: [[SCOPE2:![0-9]+]]
- // MSVC-SAME: )
- // MSVC: [[SCOPE2]] = !DICompositeType(tag: DW_TAG_structure_type,
- // MSVC-SAME: name: "S",
- // MSVC-SAME: scope: [[SCOPE1]]
- // MSVC-SAME: )
-
- // LINUX-NOT: !DINamespace
- // LINUX-NOT: !DICompositeType
- return 0;
-}
--- /dev/null
+// RUN: %clang_cc1 %s -gcodeview -debug-info-kind=line-tables-only -S \
+// RUN: -emit-llvm -o - | FileCheck %s
+// Checks that clang with "-gline-tables-only" with CodeView emits some debug
+// info for variables and types when they appear in function scopes.
+
+namespace NS {
+struct C {
+public:
+ void m() {}
+};
+void f() {}
+}
+
+NS::C c;
+
+void test() {
+ // CHECK: ![[EMPTY:[0-9]+]] = !{}
+ // CHECK: !DISubprogram(name: "f", scope: ![[NS:[0-9]+]],
+ // CHECK-SAME: type: ![[F:[0-9]+]]
+ // CHECK: ![[NS]] = !DINamespace(name: "NS", scope: null)
+ // CHECK: ![[F]] = !DISubroutineType(types: ![[EMPTY]])
+ NS::f();
+
+ // CHECK: !DISubprogram(name: "m", scope: ![[C:[0-9]+]],
+ // CHECK-SAME: type: ![[F]]
+ // CHECK: ![[C]] = !DICompositeType(tag: DW_TAG_structure_type, name: "C",
+ // CHECK-SAME: flags: DIFlagFwdDecl
+ // CHECK-NOT: identifier
+ c.m();
+}