33 lines · c
1// UNSUPPORTED: system-windows2 3// Check that we expand the executable name to an absolute path, when invoked4// with a plain executable name, which is implied to be found in PATH.5// REQUIRES: x86-registered-target6 7// RUN: rm -rf %t8// RUN: mkdir -p %t/bin9// RUN: ln -s %clang %t/bin/x86_64-w64-mingw32-clang10// RUN: split-file %s %t11// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json12 13// Check that we can deduce this both when using a compilation database, and when using14// a literal command line.15 16// RUN: env "PATH=%t/bin:%PATH%" clang-scan-deps -format experimental-full -compilation-database %t/cdb.json | FileCheck %s -DBASE=%/t17 18// RUN: env "PATH=%t/bin:%PATH%" clang-scan-deps -format experimental-full -- x86_64-w64-mingw32-clang %t/source.c -o %t/source.o | FileCheck %s -DBASE=%/t19 20// CHECK: "executable": "[[BASE]]/bin/x86_64-w64-mingw32-clang"21 22//--- cdb.json.in23[24 {25 "directory": "DIR"26 "command": "x86_64-w64-mingw32-clang -c DIR/source.c -o DIR/source.o"27 "file": "DIR/source.c"28 },29]30 31//--- source.c32void func(void) {}33