Alex Lorenz | 8679ef4 | 2019-08-26 17:59:41 +0000 | [diff] [blame] | 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 | |
Jan Korous | f8907fa | 2019-10-15 17:51:59 +0000 | [diff] [blame] | 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 | |
Alex Lorenz | 8679ef4 | 2019-08-26 17:59:41 +0000 | [diff] [blame] | 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 |