| 1 |
// UNSUPPORTED: system-windows |
| 2 |
|
| 3 |
// Check that we expand the executable name to an absolute path, when invoked |
| 4 |
// with a plain executable name, which is implied to be found in PATH. |
| 5 |
// REQUIRES: x86-registered-target |
| 6 |
|
| 7 |
// RUN: rm -rf %t |
| 8 |
// RUN: mkdir -p %t/bin |
| 9 |
// RUN: ln -s %clang %t/bin/x86_64-w64-mingw32-clang |
| 10 |
// RUN: split-file %s %t |
| 11 |
// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json |
| 12 |
|
| 13 |
// Check that we can deduce this both when using a compilation database, and when using |
| 14 |
// 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=%/t |
| 17 |
|
| 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=%/t |
| 19 |
|
| 20 |
// CHECK: "executable": "[[BASE]]/bin/x86_64-w64-mingw32-clang" |
| 21 |
|
| 22 |
//--- cdb.json.in |
| 23 |
[ |
| 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.c |
| 32 |
void func(void) {} |