Joerg Sonnenberger | cbc8725 | 2016-12-06 16:33:22 +0000 | [diff] [blame^] | 1 | // RUN: %clang -MD -MP -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s |
| 2 | // RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s |
| 3 | |
| 4 | // CHECK: { "directory": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]}, |
| 5 | // CHECK: { "directory": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]}, |
| 6 | // ERROR: error: compilation database '{{.*}}/non-existant' could not be opened: |
| 7 | |
| 8 | int main(void) { |
| 9 | return 0; |
| 10 | } |