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