| 
1 | 1 | // UNSUPPORTED: target={{.*}}-aix{{.*}}  | 
2 | 2 | //  | 
3 |  | -// The slash direction in linux and windows are different.  | 
4 |  | -// UNSUPPORTED: system-windows  | 
5 |  | -//  | 
6 | 3 | // RUN: rm -fr %t  | 
7 | 4 | // RUN: mkdir -p %t  | 
8 | 5 | // RUN: split-file %s %t  | 
9 | 6 | //  | 
10 | 7 | // RUN: sed "s|DIR|%/t|g" %t/P1689.json.in > %t/P1689.json  | 
11 | 8 | // RUN: clang-scan-deps -compilation-database %t/P1689.json -format=p1689 | FileCheck %t/Checks.cpp -DPREFIX=%/t  | 
12 |  | -// RUN: clang-scan-deps --mode=preprocess-dependency-directives -compilation-database %t/P1689.json -format=p1689 | FileCheck %t/Checks.cpp -DPREFIX=%/t  | 
 | 9 | +// RUN: clang-scan-deps --mode=preprocess-dependency-directives -compilation-database %t/P1689.json -format=p1689 \  | 
 | 10 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
 | 11 | +// RUN:   | FileCheck %t/Checks.cpp -DPREFIX=%/t  | 
13 | 12 | //  | 
14 | 13 | // Check the separated dependency format. This is required by CMake for the case  | 
15 | 14 | // that we have non-exist files in a fresh build and potentially out-of-date after that.  | 
16 | 15 | // So the build system need to wrtie a compilation database just for scanning purposes,  | 
17 | 16 | // which is not so good. So here is the per file mode for P1689.  | 
18 | 17 | // RUN: clang-scan-deps -format=p1689 \  | 
19 | 18 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/M.cppm -o %t/M.o \  | 
 | 19 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
20 | 20 | // RUN:   | FileCheck %t/M.cppm -DPREFIX=%/t  | 
21 | 21 | // RUN: clang-scan-deps -format=p1689 \  | 
22 | 22 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/Impl.cpp -o %t/Impl.o \  | 
 | 23 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
23 | 24 | // RUN:   | FileCheck %t/Impl.cpp -DPREFIX=%/t  | 
24 | 25 | // RUN: clang-scan-deps -format=p1689 \  | 
25 | 26 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/impl_part.cppm -o %t/impl_part.o \  | 
 | 27 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
26 | 28 | // RUN:   | FileCheck %t/impl_part.cppm -DPREFIX=%/t  | 
27 | 29 | // RUN: clang-scan-deps -format=p1689 \  | 
28 | 30 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/interface_part.cppm -o %t/interface_part.o \  | 
 | 31 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
29 | 32 | // RUN:   | FileCheck %t/interface_part.cppm -DPREFIX=%/t  | 
30 | 33 | // RUN: clang-scan-deps -format=p1689 \  | 
31 | 34 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/User.cpp -o %t/User.o \  | 
 | 35 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
32 | 36 | // RUN:   | FileCheck %t/User.cpp -DPREFIX=%/t  | 
33 | 37 | //  | 
34 | 38 | // Check we can generate the make-style dependencies as expected.  | 
35 | 39 | // RUN: clang-scan-deps -format=p1689 \  | 
36 | 40 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/impl_part.cppm -o %t/impl_part.o \  | 
37 | 41 | // RUN:      -MT %t/impl_part.o.ddi -MD -MF %t/impl_part.dep  | 
38 |  | -// RUN:   cat %t/impl_part.dep | FileCheck %t/impl_part.cppm -DPREFIX=%/t --check-prefix=CHECK-MAKE  | 
 | 42 | +// RUN: cat %t/impl_part.dep \  | 
 | 43 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
 | 44 | +// RUN:   | FileCheck %t/impl_part.cppm -DPREFIX=%/t --check-prefix=CHECK-MAKE  | 
39 | 45 | //  | 
40 | 46 | // Check that we can generate multiple make-style dependency information with compilation database.  | 
41 | 47 | // RUN: cat %t/P1689.dep | FileCheck %t/Checks.cpp -DPREFIX=%/t --check-prefix=CHECK-MAKE  | 
42 | 48 | //  | 
43 | 49 | // Check that we can mix the use of -format=p1689 and -fmodules.  | 
44 | 50 | // RUN: clang-scan-deps -format=p1689 \  | 
45 | 51 | // RUN:   -- %clang++ -std=c++20 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -c %t/impl_part.cppm -o %t/impl_part.o \  | 
 | 52 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
46 | 53 | // RUN:   | FileCheck %t/impl_part.cppm -DPREFIX=%/t  | 
47 | 54 | //  | 
48 | 55 | // Check the path in the make style dependencies are generated in relative path form  | 
49 | 56 | // RUN: cd %t  | 
50 | 57 | // RUN: clang-scan-deps -format=p1689 \  | 
51 | 58 | // RUN:   -- %clang++ -std=c++20 -c -fprebuilt-module-path=%t impl_part.cppm -o impl_part.o \  | 
52 | 59 | // RUN:      -MT impl_part.o.ddi -MD -MF impl_part.dep  | 
53 |  | -// RUN:   cat impl_part.dep | FileCheck impl_part.cppm -DPREFIX=%/t --check-prefix=CHECK-MAKE-RELATIVE  | 
 | 60 | +// RUN: cat impl_part.dep \  | 
 | 61 | +// RUN:   | sed 's:\\\\\?:/:g' \  | 
 | 62 | +// RUN:   | FileCheck impl_part.cppm -DPREFIX=%/t --check-prefix=CHECK-MAKE-RELATIVE  | 
54 | 63 | 
 
  | 
55 | 64 | 
 
  | 
56 | 65 | //--- P1689.json.in  | 
 | 
0 commit comments