xref: /llvm-project/clang/test/Modules/relative-import-path.c (revision 1b1d372b423413dc8b2c5cca86240e9ae79afcc6)
10a2be46cSDuncan P. N. Exon Smith // RUN: rm -rf %t
2*1b1d372bSBenjamin Kramer // RUN: cp -r %S/Inputs/relative-import-path %t
30a2be46cSDuncan P. N. Exon Smith // RUN: cp %s %t/t.c
40a2be46cSDuncan P. N. Exon Smith 
50a2be46cSDuncan P. N. Exon Smith // Use FileCheck, which is more flexible.
60a2be46cSDuncan P. N. Exon Smith //
70a2be46cSDuncan P. N. Exon Smith // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache \
80a2be46cSDuncan P. N. Exon Smith // RUN:     -fdisable-module-hash -fsyntax-only \
90a2be46cSDuncan P. N. Exon Smith // RUN:     -I%S/Inputs/relative-import-path \
100a2be46cSDuncan P. N. Exon Smith // RUN:     -working-directory=%t \
110a2be46cSDuncan P. N. Exon Smith // RUN:     -Rmodule-build -Rmodule-import t.c 2>&1 |\
120a2be46cSDuncan P. N. Exon Smith // RUN: FileCheck %s -implicit-check-not "remark:" -DWORKDIR=%t
130a2be46cSDuncan P. N. Exon Smith 
140a2be46cSDuncan P. N. Exon Smith #include "A.h" // \
150a2be46cSDuncan P. N. Exon Smith // CHECK: remark: building module 'A'
160a2be46cSDuncan P. N. Exon Smith // CHECK: remark: building module 'B'
170a2be46cSDuncan P. N. Exon Smith // CHECK: remark: building module 'C'
180a2be46cSDuncan P. N. Exon Smith // CHECK: remark: finished building module 'C'
192fd0d227SDuncan P. N. Exon Smith // CHECK: remark: importing module 'C' from '[[WORKDIR]]{{[/\\]cache[/\\]}}C.pcm'
200a2be46cSDuncan P. N. Exon Smith // CHECK: remark: finished building module 'B'
212fd0d227SDuncan P. N. Exon Smith // CHECK: remark: importing module 'B' from '[[WORKDIR]]{{[/\\]cache[/\\]}}B.pcm'
222fd0d227SDuncan P. N. Exon Smith // CHECK: remark: importing module 'C' into 'B' from '[[WORKDIR]]{{[/\\]cache[/\\]}}C.pcm'
230a2be46cSDuncan P. N. Exon Smith // CHECK: remark: finished building module 'A'
242fd0d227SDuncan P. N. Exon Smith // CHECK: remark: importing module 'A' from '[[WORKDIR]]{{[/\\]cache[/\\]}}A.pcm'
252fd0d227SDuncan P. N. Exon Smith // CHECK: remark: importing module 'B' into 'A' from '[[WORKDIR]]{{[/\\]cache[/\\]}}B.pcm'
262fd0d227SDuncan P. N. Exon Smith // CHECK: remark: importing module 'C' into 'B' from '[[WORKDIR]]{{[/\\]cache[/\\]}}C.pcm'
27