69 lines · cpp
1// UNSUPPORTED: target={{.*}}-aix{{.*}}2 3// RUN: rm -rf %t.dir4// RUN: rm -rf %t.cdb5// RUN: rm -rf %t_clangcl.cdb6// RUN: mkdir -p %t.dir7// RUN: cp %s %t.dir/regular_cdb_input.cpp8// RUN: cp %s %t.dir/regular_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: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb13// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb_clangcl.json > %t_clangcl.cdb14//15// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-dependency-directives | \16// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s17// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-dependency-directives | \18// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s19 20// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \21// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s22// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess | \23// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s24 25// Make sure we didn't produce any dependency files!26// RUN: not cat %t.dir/regular_cdb.d27// RUN: not cat %t.dir/regular_cdb_clangcl.d28// RUN: not cat %t.dir/regular_cdb2.d29// RUN: not cat %t.dir/regular_cdb2_clangcl.d30//31// The output order is non-deterministic when using more than one thread,32// so check the output using two runs. Note that the 'NOT' check is not used33// as it might fail if the results for `regular_cdb_input.cpp` are reported before34// `regular_cdb_input2.cpp`.35//36// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-dependency-directives | \37// RUN: FileCheck --check-prefix=CHECK1 %s38// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-dependency-directives | \39// RUN: FileCheck --check-prefix=CHECK1 %s40 41// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \42// RUN: FileCheck --check-prefix=CHECK1 %s43// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \44// RUN: FileCheck --check-prefix=CHECK1 %s45 46// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-dependency-directives | \47// RUN: FileCheck --check-prefix=CHECK2 %s48// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-dependency-directives | \49// RUN: FileCheck --check-prefix=CHECK2 %s50 51// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \52// RUN: FileCheck --check-prefix=CHECK2 %s53// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \54// RUN: FileCheck --check-prefix=CHECK2 %s55 56#include "header.h"57 58// CHECK1: regular_cdb_input2.o:59// CHECK1-NEXT: regular_cdb_input2.cpp60// CHECK1-NEXT: Inputs{{/|\\}}header.h61// CHECK1-NEXT: Inputs{{/|\\}}header2.h62 63// CHECK2: regular_cdb_input.o:64// CHECK2-NEXT: regular_cdb_input.cpp65// CHECK2-NEXT: Inputs{{/|\\}}header.h66// CHECK2NO-NOT: header267 68// CHECK3: adena.o:69