| 1 |
// Check that we can detect an implicit target when clang is invoked as |
| 2 |
// <triple->clang. Using an implicit triple requires that the target actually |
| 3 |
// is available, too. |
| 4 |
// REQUIRES: x86-registered-target |
| 5 |
|
| 6 |
// RUN: rm -rf %t |
| 7 |
// RUN: split-file %s %t |
| 8 |
// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json |
| 9 |
|
| 10 |
// Check that we can deduce this both when using a compilation database, and when using |
| 11 |
// a literal command line. |
| 12 |
|
| 13 |
// RUN: clang-scan-deps -format experimental-full -compilation-database %t/cdb.json | FileCheck %s |
| 14 |
|
| 15 |
// RUN: clang-scan-deps -format experimental-full -- x86_64-w64-mingw32-clang %t/source.c -o %t/source.o | FileCheck %s |
| 16 |
|
| 17 |
// CHECK: "-triple", |
| 18 |
// CHECK-NEXT: "x86_64-w64-windows-gnu", |
| 19 |
|
| 20 |
|
| 21 |
//--- cdb.json.in |
| 22 |
[ |
| 23 |
{ |
| 24 |
"directory": "DIR" |
| 25 |
"command": "x86_64-w64-mingw32-clang -c DIR/source.c -o DIR/source.o" |
| 26 |
"file": "DIR/source.c" |
| 27 |
}, |
| 28 |
] |
| 29 |
|
| 30 |
//--- source.c |
| 31 |
void func(void) {} |