[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-gline-tables-only-codeview.cpp
blob6b9c9a243decd1ee68b6b0b4b15f459ddd49469a
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.
6 namespace NS {
7 struct C {
8 void m() {}
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; }()) {}
15 void f() {}
18 // Test non- externally visible lambda.
19 auto lambda1 = []() { return 1; };
21 NS::C c;
24 void test() {
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}
30 NS::f();
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: !{{.*}})
38 c.m();
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
44 lambda1();
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>",
52 c.lambda_params();
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
58 c.lambda2();