xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/Rmodule-build.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: rm -rf %t
2*0a6a1f1dSLionel Sambuc// RUN: mkdir %t
3*0a6a1f1dSLionel Sambuc// RUN: echo '// A' > %t/A.h
4*0a6a1f1dSLionel Sambuc// RUN: echo '#include "C.h"' > %t/B.h
5*0a6a1f1dSLionel Sambuc// RUN: echo '// C' > %t/C.h
6*0a6a1f1dSLionel Sambuc// RUN: echo 'module A { header "A.h" }' > %t/module.modulemap
7*0a6a1f1dSLionel Sambuc// RUN: echo 'module B { header "B.h" }' >> %t/module.modulemap
8*0a6a1f1dSLionel Sambuc// RUN: echo 'module C { header "C.h" }' >> %t/module.modulemap
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -verify \
11*0a6a1f1dSLionel Sambuc// RUN:            -I %t -Rmodule-build
12*0a6a1f1dSLionel Sambuc
13*0a6a1f1dSLionel Sambuc@import A; // expected-remark{{building module 'A' as}} expected-remark {{finished building module 'A'}}
14*0a6a1f1dSLionel Sambuc@import B; // expected-remark{{building module 'B' as}} expected-remark {{finished building module 'B'}}
15*0a6a1f1dSLionel Sambuc@import A; // no diagnostic
16*0a6a1f1dSLionel Sambuc@import B; // no diagnostic
17*0a6a1f1dSLionel Sambuc
18*0a6a1f1dSLionel Sambuc// RUN: echo ' ' >> %t/C.h
19*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
20*0a6a1f1dSLionel Sambuc// RUN:            -Rmodule-build 2>&1 | FileCheck %s
21*0a6a1f1dSLionel Sambuc
22*0a6a1f1dSLionel Sambuc// RUN: echo ' ' >> %t/C.h
23*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
24*0a6a1f1dSLionel Sambuc// RUN:            -Reverything 2>&1 | FileCheck %s
25*0a6a1f1dSLionel Sambuc
26*0a6a1f1dSLionel Sambuc// RUN: echo ' ' >> %t/B.h
27*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
28*0a6a1f1dSLionel Sambuc// RUN:            2>&1 | FileCheck -allow-empty -check-prefix=NO-REMARKS %s
29*0a6a1f1dSLionel Sambuc
30*0a6a1f1dSLionel Sambuc// RUN: echo ' ' >> %t/B.h
31*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
32*0a6a1f1dSLionel Sambuc// RUN:            -Rmodule-build -Rno-everything 2>&1 | \
33*0a6a1f1dSLionel Sambuc// RUN:    FileCheck -allow-empty -check-prefix=NO-REMARKS %s
34*0a6a1f1dSLionel Sambuc
35*0a6a1f1dSLionel Sambuc// CHECK-NOT: building module 'A'
36*0a6a1f1dSLionel Sambuc// CHECK: building module 'B'
37*0a6a1f1dSLionel Sambuc// CHECK: building module 'C'
38*0a6a1f1dSLionel Sambuc// CHECK: finished building module 'C'
39*0a6a1f1dSLionel Sambuc// CHECK: finished building module 'B'
40*0a6a1f1dSLionel Sambuc// NO-REMARKS-NOT: building module 'A'
41*0a6a1f1dSLionel Sambuc// NO-REMARKS-NOT: building module 'B'
42