1 // RUN: %clang_cc1 %s -gcodeview -debug-info-kind=line-tables-only -S \
2 // RUN:   -emit-llvm -o - | FileCheck %s
3 // Checks that clang with "-gline-tables-only" with CodeView emits some debug
4 // info for variables and types when they appear in function scopes.
5 
6 namespace NS {
7 struct C {
8 public:
9   void m() {}
10 };
11 void f() {}
12 }
13 
14 NS::C c;
15 
16 void test() {
17   // CHECK: ![[EMPTY:[0-9]+]] = !{}
18   // CHECK: !DISubprogram(name: "f", scope: ![[NS:[0-9]+]],
19   // CHECK-SAME:          type: ![[F:[0-9]+]]
20   // CHECK: ![[NS]] = !DINamespace(name: "NS", scope: null)
21   // CHECK: ![[F]] = !DISubroutineType(types: ![[EMPTY]])
22   NS::f();
23 
24   // CHECK: !DISubprogram(name: "m", scope: ![[C:[0-9]+]],
25   // CHECK-SAME:          type: ![[F]]
26   // CHECK: ![[C]] = !DICompositeType(tag: DW_TAG_structure_type, name: "C",
27   // CHECK-SAME:                      flags: DIFlagFwdDecl
28   // CHECK-NOT: identifier
29   c.m();
30 }
31