[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / func-mapping-test.cpp
blob44bbf8509720105fe2fe09f015bf654b99af5f2a
1 // RUN: %clang_extdef_map %s -- | FileCheck --implicit-check-not "c:@y" --implicit-check-not "c:@z" %s
3 int f(int) {
4 return 0;
6 // CHECK-DAG: 9:c:@F@f#I#
8 extern const int x = 5;
9 // CHECK-DAG: 4:c:@x
11 // Non-const variables should not be collected.
12 int y = 5;
14 // In C++, const implies internal linkage, so not collected.
15 const int z = 5;
17 struct S {
18 int a;
20 extern S const s = {.a = 2};
21 // CHECK-DAG: 4:c:@s
23 struct SF {
24 const int a;
26 SF sf = {.a = 2};
27 // CHECK-DAG: 5:c:@sf
29 struct SStatic {
30 static const int a = 4;
32 const int SStatic::a;
33 // CHECK-DAG: 14:c:@S@SStatic@a
35 extern int const arr[5] = { 0, 1 };
36 // CHECK-DAG: 6:c:@arr
38 union U {
39 const int a;
40 const unsigned int b;
42 U u = {.a = 6};
43 // CHECK-DAG: 4:c:@u
45 // No USR can be generated for this.
46 // Check for no crash in this case.
47 static union {
48 float uf;
49 const int ui;
52 void f(int (*)(char));
53 void f(bool (*)(char));
55 struct G {
56 G() {
57 f([](char) -> int { return 42; });
58 // CHECK-DAG: 41:c:@S@G@F@G#@Sa@F@operator int (*)(char)#1
59 f([](char) -> bool { return true; });
60 // CHECK-DAG: 42:c:@S@G@F@G#@Sa@F@operator bool (*)(char)#1