2 // MAIN - includes textual_1.h
3 // \ loads pch_1.h - includes textual_2.h
8 // RUN: split-file %s %t
10 // RUN: %clang_cc1 -Wno-unused-value -std=c++20 -emit-pch -o %t/pch_2.h.pch %t/pch_2.h -x c++
11 // RUN: %clang_cc1 -Wno-unused-value -std=c++20 -include-pch %t/pch_2.h.pch -emit-pch -o %t/pch_1.h.pch %t/pch_1.h -x c++
12 // RUN: %clang_cc1 -Wno-unused-value -std=c++20 -include-pch %t/pch_1.h.pch -verify %t/main.cpp -Wunsafe-buffer-usage
17 s
[2]; // <- expected warning here
18 #pragma clang unsafe_buffer_usage begin
20 #pragma clang unsafe_buffer_usage end
25 s
[2]; // <- expected warning here
26 #pragma clang unsafe_buffer_usage begin
28 #pragma clang unsafe_buffer_usage end
32 #include "textual_2.h"
35 s
[2]; // <- expected warning here
36 #pragma clang unsafe_buffer_usage begin
38 #pragma clang unsafe_buffer_usage end
43 s
[2]; // <- expected warning here
44 #pragma clang unsafe_buffer_usage begin
46 #pragma clang unsafe_buffer_usage end
51 #include "textual_1.h"
52 // expected-warning@textual_1.h:2{{unsafe buffer access}} \
53 expected
-note@textual_1
.h
:2{{pass
-fsafe
-buffer
-usage
-suggestions to receive code hardening suggestions
}}
54 // expected-warning@textual_2.h:2{{unsafe buffer access}} \
55 expected
-note@textual_2
.h
:2{{pass
-fsafe
-buffer
-usage
-suggestions to receive code hardening suggestions
}}
56 // expected-warning@pch_1.h:4{{unsafe buffer access}} \
57 expected
-note@pch_1
.h
:4{{pass
-fsafe
-buffer
-usage
-suggestions to receive code hardening suggestions
}}
58 // expected-warning@pch_2.h:2{{unsafe buffer access}} \
59 expected
-note@pch_2
.h
:2{{pass
-fsafe
-buffer
-usage
-suggestions to receive code hardening suggestions
}}
62 return a(s
) + b(s
) + c(s
) + d(s
);