56 lines · cpp
1// RUN: rm -rf %t.dir2// RUN: rm -rf %t.cdb3// RUN: rm -rf %t_clangcl.cdb4// RUN: rm -rf %t.module-cache5// RUN: rm -rf %t.module-cache_clangcl6// RUN: mkdir -p %t.dir7// RUN: cp %s %t.dir/modules_cdb_input.cpp8// RUN: cp %s %t.dir/modules_cdb_input2.cpp9// RUN: mkdir %t.dir/Inputs10// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h11// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h12// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap13// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb14// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl.json > %t_clangcl.cdb15//16// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-dependency-directives | \17// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s18// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-dependency-directives | \19// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s20//21// The output order is non-deterministic when using more than one thread,22// so check the output using two runs. Note that the 'NOT' check is not used23// as it might fail if the results for `modules_cdb_input.cpp` are reported before24// `modules_cdb_input2.cpp`.25//26// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-dependency-directives | \27// RUN: FileCheck --check-prefix=CHECK1 %s28// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-dependency-directives | \29// RUN: FileCheck --check-prefix=CHECK1 %s30// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \31// RUN: FileCheck --check-prefix=CHECK1 %s32// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \33// RUN: FileCheck --check-prefix=CHECK1 %s34// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-dependency-directives | \35// RUN: FileCheck --check-prefix=CHECK2 %s36// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-dependency-directives | \37// RUN: FileCheck --check-prefix=CHECK2 %s38// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \39// RUN: FileCheck --check-prefix=CHECK2 %s40// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \41// RUN: FileCheck --check-prefix=CHECK2 %s42 43#include "header.h"44 45// CHECK1: modules_cdb_input2.o:46// CHECK1-NEXT: modules_cdb_input2.cpp47// CHECK1-NEXT: Inputs{{/|\\}}module.modulemap48// CHECK1-NEXT: Inputs{{/|\\}}header2.h49// CHECK1: Inputs{{/|\\}}header.h50 51// CHECK2: {{(modules_cdb_input)|(a)|(b)}}.o:52// CHECK2-NEXT: modules_cdb_input.cpp53// CHECK2-NEXT: Inputs{{/|\\}}module.modulemap54// CHECK2-NEXT: Inputs{{/|\\}}header.h55// CHECK2NO-NOT: header256