| 1 |
// REQUIRES: x86-registered-target |
| 2 |
// RUN: rm -rf %t.cdb |
| 3 |
// RUN: %clang -target x86_64-apple-macos10.15 -c %s -o - -gen-cdb-fragment-path %t.cdb |
| 4 |
// RUN: ls %t.cdb | FileCheck --check-prefix=CHECK-LS %s |
| 5 |
// CHECK-LS: gen-cdb-fragment.c.{{.*}}.json |
| 6 |
|
| 7 |
// RUN: cat %t.cdb/*.json | FileCheck --check-prefix=CHECK %s |
| 8 |
// CHECK: { "directory": "{{.*}}", "file": "{{.*}}gen-cdb-fragment.c", "output": "-", "arguments": [{{.*}}, "--target=x86_64-apple-macos10.15"{{.*}}]}, |
| 9 |
// RUN: cat %t.cdb/*.json | FileCheck --check-prefix=CHECK-FLAG %s |
| 10 |
// CHECK-FLAG-NOT: -gen-cdb-fragment-path |
| 11 |
|
| 12 |
// RUN: rm -rf %t.cdb |
| 13 |
// RUN: mkdir %t.cdb |
| 14 |
// RUN: ls %t.cdb | not FileCheck --check-prefix=CHECK-LS %s |
| 15 |
// RUN: %clang -target x86_64-apple-macos10.15 -S %s -o - -gen-cdb-fragment-path %t.cdb |
| 16 |
// RUN: ls %t.cdb | FileCheck --check-prefix=CHECK-LS %s |
| 17 |
|
| 18 |
// Working directory arg is respected. |
| 19 |
// RUN: rm -rf %t.cdb |
| 20 |
// RUN: mkdir %t.cdb |
| 21 |
// RUN: %clang -target x86_64-apple-macos10.15 -working-directory %t.cdb -c %s -o - -gen-cdb-fragment-path "." |
| 22 |
// RUN: ls %t.cdb | FileCheck --check-prefix=CHECK-LS %s |
| 23 |
// RUN: cat %t.cdb/*.json | FileCheck --check-prefix=CHECK-CWD %s |
| 24 |
// CHECK-CWD: "directory": "{{.*}}.cdb" |
| 25 |
|
| 26 |
// -### does not emit the CDB fragment |
| 27 |
// RUN: rm -rf %t.cdb |
| 28 |
// RUN: mkdir %t.cdb |
| 29 |
// RUN: %clang -target x86_64-apple-macos10.15 -S %s -o - -gen-cdb-fragment-path %t.cdb -### |
| 30 |
// RUN: ls %t.cdb | not FileCheck --check-prefix=CHECK-LS %s |
| 31 |
|
| 32 |
// -MJ is preferred over -gen-cdb-fragment-path |
| 33 |
// RUN: rm -rf %t.cdb |
| 34 |
// RUN: mkdir %t.cdb |
| 35 |
// RUN: %clang -target x86_64-apple-macos10.15 -S %s -o - -gen-cdb-fragment-path %t.cdb -MJ %t.out |
| 36 |
// RUN: ls %t.cdb | not FileCheck --check-prefix=CHECK-LS %s |
| 37 |
// RUN: FileCheck %s < %t.out |