llvm-project
124 строки · 5.4 Кб
1// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -- | FileCheck --strict-whitespace %s
2
3#pragma clang diagnostic push4#pragma clang diagnostic pop5#pragma clang diagnostic ignored "-Wformat"6#pragma clang diagnostic warning "-Wformat"7#pragma clang diagnostic error "-Wformat"8#pragma clang diagnostic fatal "-Wformat"9
10#pragma GCC diagnostic push11#pragma GCC diagnostic pop12#pragma GCC diagnostic ignored "-Wformat"13#pragma GCC diagnostic warning "-Wformat"14#pragma GCC diagnostic error "-Wformat"15#pragma GCC diagnostic fatal "-Wformat"16
17void foo() {18#pragma clang __debug captured19{ }20}
21
22// CHECK: ---
23// CHECK-NEXT: - Callback: PragmaDirective
24// CHECK-NEXT: Loc: "<built-in>:{{.+}}:1"
25// CHECK-NEXT: Introducer: PIK_HashPragma
26// CHECK-NEXT: - Callback: PragmaDirective
27// CHECK-NEXT: Loc: "<built-in>:{{.+}}:1"
28// CHECK-NEXT: Introducer: PIK_HashPragma
29// CHECK-NEXT: - Callback: PragmaDirective
30// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:3:1"
31// CHECK-NEXT: Introducer: PIK_HashPragma
32// CHECK-NEXT: - Callback: PragmaDiagnosticPush
33// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:3:15"
34// CHECK-NEXT: Namespace: clang
35// CHECK-NEXT: - Callback: PragmaDirective
36// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:4:1"
37// CHECK-NEXT: Introducer: PIK_HashPragma
38// CHECK-NEXT: - Callback: PragmaDiagnosticPop
39// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:4:15"
40// CHECK-NEXT: Namespace: clang
41// CHECK-NEXT: - Callback: PragmaDirective
42// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:5:1"
43// CHECK-NEXT: Introducer: PIK_HashPragma
44// CHECK-NEXT: - Callback: PragmaDiagnostic
45// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:5:15"
46// CHECK-NEXT: Namespace: clang
47// CHECK-NEXT: Mapping: MAP_IGNORE
48// CHECK-NEXT: Str: -Wformat
49// CHECK-NEXT: - Callback: PragmaDirective
50// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:6:1"
51// CHECK-NEXT: Introducer: PIK_HashPragma
52// CHECK-NEXT: - Callback: PragmaDiagnostic
53// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:6:15"
54// CHECK-NEXT: Namespace: clang
55// CHECK-NEXT: Mapping: MAP_WARNING
56// CHECK-NEXT: Str: -Wformat
57// CHECK-NEXT: - Callback: PragmaDirective
58// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:7:1"
59// CHECK-NEXT: Introducer: PIK_HashPragma
60// CHECK-NEXT: - Callback: PragmaDiagnostic
61// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:7:15"
62// CHECK-NEXT: Namespace: clang
63// CHECK-NEXT: Mapping: MAP_ERROR
64// CHECK-NEXT: Str: -Wformat
65// CHECK-NEXT: - Callback: PragmaDirective
66// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:8:1"
67// CHECK-NEXT: Introducer: PIK_HashPragma
68// CHECK-NEXT: - Callback: PragmaDiagnostic
69// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:8:15"
70// CHECK-NEXT: Namespace: clang
71// CHECK-NEXT: Mapping: MAP_FATAL
72// CHECK-NEXT: Str: -Wformat
73// CHECK-NEXT: - Callback: PragmaDirective
74// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:10:1"
75// CHECK-NEXT: Introducer: PIK_HashPragma
76// CHECK-NEXT: - Callback: PragmaDiagnosticPush
77// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:10:13"
78// CHECK-NEXT: Namespace: GCC
79// CHECK-NEXT: - Callback: PragmaDirective
80// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:11:1"
81// CHECK-NEXT: Introducer: PIK_HashPragma
82// CHECK-NEXT: - Callback: PragmaDiagnosticPop
83// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:11:13"
84// CHECK-NEXT: Namespace: GCC
85// CHECK-NEXT: - Callback: PragmaDirective
86// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:12:1"
87// CHECK-NEXT: Introducer: PIK_HashPragma
88// CHECK-NEXT: - Callback: PragmaDiagnostic
89// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:12:13"
90// CHECK-NEXT: Namespace: GCC
91// CHECK-NEXT: Mapping: MAP_IGNORE
92// CHECK-NEXT: Str: -Wformat
93// CHECK-NEXT: - Callback: PragmaDirective
94// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:13:1"
95// CHECK-NEXT: Introducer: PIK_HashPragma
96// CHECK-NEXT: - Callback: PragmaDiagnostic
97// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:13:13"
98// CHECK-NEXT: Namespace: GCC
99// CHECK-NEXT: Mapping: MAP_WARNING
100// CHECK-NEXT: Str: -Wformat
101// CHECK-NEXT: - Callback: PragmaDirective
102// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:14:1"
103// CHECK-NEXT: Introducer: PIK_HashPragma
104// CHECK-NEXT: - Callback: PragmaDiagnostic
105// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:14:13"
106// CHECK-NEXT: Namespace: GCC
107// CHECK-NEXT: Mapping: MAP_ERROR
108// CHECK-NEXT: Str: -Wformat
109// CHECK-NEXT: - Callback: PragmaDirective
110// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:15:1"
111// CHECK-NEXT: Introducer: PIK_HashPragma
112// CHECK-NEXT: - Callback: PragmaDiagnostic
113// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:15:13"
114// CHECK-NEXT: Namespace: GCC
115// CHECK-NEXT: Mapping: MAP_FATAL
116// CHECK-NEXT: Str: -Wformat
117// CHECK-NEXT: - Callback: PragmaDirective
118// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:18:1"
119// CHECK-NEXT: Introducer: PIK_HashPragma
120// CHECK-NEXT: - Callback: PragmaDebug
121// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:18:23"
122// CHECK-NEXT: DebugType: captured
123// CHECK-NEXT: - Callback: EndOfMainFile
124// CHECK-NEXT: ...
125