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