1// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -- | FileCheck --strict-whitespace %s
2
3#pragma clang diagnostic push
4#pragma clang diagnostic pop
5#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 push
11#pragma GCC diagnostic pop
12#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 captured
19{ }
20}
21
22// CHECK: ---
23// CHECK-NEXT: - Callback: PragmaDirective
24// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:3:1"
25// CHECK-NEXT: Introducer: PIK_HashPragma
26// CHECK-NEXT: - Callback: PragmaDiagnosticPush
27// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:3:15"
28// CHECK-NEXT: Namespace: clang
29// CHECK-NEXT: - Callback: PragmaDirective
30// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:4:1"
31// CHECK-NEXT: Introducer: PIK_HashPragma
32// CHECK-NEXT: - Callback: PragmaDiagnosticPop
33// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:4:15"
34// CHECK-NEXT: Namespace: clang
35// CHECK-NEXT: - Callback: PragmaDirective
36// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:5:1"
37// CHECK-NEXT: Introducer: PIK_HashPragma
38// CHECK-NEXT: - Callback: PragmaDiagnostic
39// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:5:15"
40// CHECK-NEXT: Namespace: clang
41// CHECK-NEXT: Mapping: MAP_IGNORE
42// CHECK-NEXT: Str: -Wformat
43// CHECK-NEXT: - Callback: PragmaDirective
44// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:6:1"
45// CHECK-NEXT: Introducer: PIK_HashPragma
46// CHECK-NEXT: - Callback: PragmaDiagnostic
47// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:6:15"
48// CHECK-NEXT: Namespace: clang
49// CHECK-NEXT: Mapping: MAP_WARNING
50// CHECK-NEXT: Str: -Wformat
51// CHECK-NEXT: - Callback: PragmaDirective
52// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:7:1"
53// CHECK-NEXT: Introducer: PIK_HashPragma
54// CHECK-NEXT: - Callback: PragmaDiagnostic
55// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:7:15"
56// CHECK-NEXT: Namespace: clang
57// CHECK-NEXT: Mapping: MAP_ERROR
58// CHECK-NEXT: Str: -Wformat
59// CHECK-NEXT: - Callback: PragmaDirective
60// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:8:1"
61// CHECK-NEXT: Introducer: PIK_HashPragma
62// CHECK-NEXT: - Callback: PragmaDiagnostic
63// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:8:15"
64// CHECK-NEXT: Namespace: clang
65// CHECK-NEXT: Mapping: MAP_FATAL
66// CHECK-NEXT: Str: -Wformat
67// CHECK-NEXT: - Callback: PragmaDirective
68// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:10:1"
69// CHECK-NEXT: Introducer: PIK_HashPragma
70// CHECK-NEXT: - Callback: PragmaDiagnosticPush
71// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:10:13"
72// CHECK-NEXT: Namespace: GCC
73// CHECK-NEXT: - Callback: PragmaDirective
74// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:11:1"
75// CHECK-NEXT: Introducer: PIK_HashPragma
76// CHECK-NEXT: - Callback: PragmaDiagnosticPop
77// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:11:13"
78// CHECK-NEXT: Namespace: GCC
79// CHECK-NEXT: - Callback: PragmaDirective
80// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:12:1"
81// CHECK-NEXT: Introducer: PIK_HashPragma
82// CHECK-NEXT: - Callback: PragmaDiagnostic
83// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:12:13"
84// CHECK-NEXT: Namespace: GCC
85// CHECK-NEXT: Mapping: MAP_IGNORE
86// CHECK-NEXT: Str: -Wformat
87// CHECK-NEXT: - Callback: PragmaDirective
88// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:13:1"
89// CHECK-NEXT: Introducer: PIK_HashPragma
90// CHECK-NEXT: - Callback: PragmaDiagnostic
91// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:13:13"
92// CHECK-NEXT: Namespace: GCC
93// CHECK-NEXT: Mapping: MAP_WARNING
94// CHECK-NEXT: Str: -Wformat
95// CHECK-NEXT: - Callback: PragmaDirective
96// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:14:1"
97// CHECK-NEXT: Introducer: PIK_HashPragma
98// CHECK-NEXT: - Callback: PragmaDiagnostic
99// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:14:13"
100// CHECK-NEXT: Namespace: GCC
101// CHECK-NEXT: Mapping: MAP_ERROR
102// CHECK-NEXT: Str: -Wformat
103// CHECK-NEXT: - Callback: PragmaDirective
104// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:15:1"
105// CHECK-NEXT: Introducer: PIK_HashPragma
106// CHECK-NEXT: - Callback: PragmaDiagnostic
107// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:15:13"
108// CHECK-NEXT: Namespace: GCC
109// CHECK-NEXT: Mapping: MAP_FATAL
110// CHECK-NEXT: Str: -Wformat
111// CHECK-NEXT: - Callback: PragmaDirective
112// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:18:1"
113// CHECK-NEXT: Introducer: PIK_HashPragma
114// CHECK-NEXT: - Callback: PragmaDebug
115// CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-pragma-general.cpp:18:23"
116// CHECK-NEXT: DebugType: captured
117// CHECK-NEXT: - Callback: EndOfMainFile
118// CHECK-NEXT: ...
119

source code of clang-tools-extra/test/pp-trace/pp-trace-pragma-general.cpp