xref: /aosp_15_r20/external/clang/test/Modules/Werror-Wsystem-headers.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: rm -rf %t
2*67e74705SXin Li// RUN: rm -rf %t-saved
3*67e74705SXin Li// RUN: mkdir %t-saved
4*67e74705SXin Li
5*67e74705SXin Li// Initial module build
6*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
7*67e74705SXin Li// RUN:     -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify
8*67e74705SXin Li// RUN: cp %t/cstd.pcm %t-saved/cstd.pcm
9*67e74705SXin Li
10*67e74705SXin Li// Even with -Werror don't rebuild a system module
11*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
12*67e74705SXin Li// RUN:     -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify -Werror
13*67e74705SXin Li// RUN: diff %t/cstd.pcm %t-saved/cstd.pcm
14*67e74705SXin Li
15*67e74705SXin Li// Unless -Wsystem-headers is on
16*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
17*67e74705SXin Li// RUN:     -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify \
18*67e74705SXin Li// RUN:     -Werror=unused -Wsystem-headers
19*67e74705SXin Li// RUN: not diff %t/cstd.pcm %t-saved/cstd.pcm
20*67e74705SXin Li
21*67e74705SXin Li// expected-no-diagnostics
22*67e74705SXin Li@import cstd;
23