1 // RUN: %clang_cc1 %s -triple x86_64-windows-msvc -gcodeview \
2 // RUN: -debug-info-kind=line-tables-only -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.
9 // Test externally visible lambda.
10 void lambda2() { []() {}(); }
12 // Test naming for function parameters.
13 void lambda_params(int x
= [](){ return 0; }(), int y
= [](){ return 1; }()) {}
18 // Test non- externally visible lambda.
19 auto lambda1
= []() { return 1; };
25 // CHECK: !DISubprogram(name: "f", scope: ![[NS:[0-9]+]],
26 // CHECK-SAME: type: ![[F:[0-9]+]]
27 // CHECK: ![[NS]] = !DINamespace(name: "NS", scope: null)
28 // CHECK: ![[F]] = !DISubroutineType(types: ![[FTYPE:[0-9]+]])
29 // CHECK: ![[FTYPE]] = !{null}
32 // CHECK: ![[M:[0-9]+]] = distinct !DISubprogram(name: "m", scope: ![[C:[0-9]+]],
33 // CHECK-SAME: type: ![[MTYPE:[0-9]+]],
34 // CHECK: ![[C]] = !DICompositeType(tag: DW_TAG_structure_type, name: "C",
35 // CHECK-SAME: flags: DIFlagFwdDecl
36 // CHECK-NOT: identifier
37 // CHECK: ![[MTYPE]] = !DISubroutineType({{.*}}types: !{{.*}})
40 // CHECK: !DISubprogram(name: "operator()", scope: ![[LAMBDA0:[0-9]+]],
41 // CHECK: ![[LAMBDA0]] = !DICompositeType(tag: DW_TAG_class_type,
42 // CHECK-SAME: name: "<lambda_0>",
43 // CHECK-SAME: flags: DIFlagFwdDecl
46 // CHECK: !DISubprogram(name: "operator()", scope: ![[LAMBDA1_1:[0-9]+]],
47 // CHECK: ![[LAMBDA1_1]] = !DICompositeType(tag: DW_TAG_class_type,
48 // CHECK-SAME: name: "<lambda_1_1>",
49 // CHECK: !DISubprogram(name: "operator()", scope: ![[LAMBDA2_1:[0-9]+]],
50 // CHECK: ![[LAMBDA2_1]] = !DICompositeType(tag: DW_TAG_class_type,
51 // CHECK-SAME: name: "<lambda_2_1>",
54 // CHECK: !DISubprogram(name: "operator()", scope: ![[LAMBDA1:[0-9]+]],
55 // CHECK: ![[LAMBDA1]] = !DICompositeType(tag: DW_TAG_class_type,
56 // CHECK-SAME: name: "<lambda_1>",
57 // CHECK-SAME: flags: DIFlagFwdDecl