diff options
author | Hans Wennborg <hans@hanshq.net> | 2019-09-27 08:14:45 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2019-09-27 08:14:45 +0000 |
commit | 0f7791ecb9716fb6e5c3493db28b7dcf44a06440 (patch) | |
tree | ad5cee8dfeab099246f1fe92e8dacf6d55a6ef58 /test/Driver | |
parent | 30a86d713662851930f6cf07343aba0dd5836f26 (diff) | |
download | clang-0f7791ecb9716fb6e5c3493db28b7dcf44a06440.tar.gz |
Fix the 'directory' field in DumpCompilationDatabase and add test
This broke in r371027 due to a missing negation
(llvm::sys::fs::current_path returns false on success).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver')
-rw-r--r-- | test/Driver/compilation_database.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Driver/compilation_database.c b/test/Driver/compilation_database.c index 017178d60c..343b76aa44 100644 --- a/test/Driver/compilation_database.c +++ b/test/Driver/compilation_database.c @@ -1,8 +1,8 @@ -// RUN: mkdir -p %t && cd %t +// RUN: mkdir -p %t.workdir && cd %t.workdir // RUN: %clang -MD -MP --sysroot=somewhere -c -x c %s -xc++ %s -Wall -MJ - -no-canonical-prefixes 2>&1 | FileCheck %s // RUN: not %clang -c -x c %s -MJ %s/non-existant -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=ERROR %s -// CHECK: { "directory": "{{.*}}", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]}, +// CHECK: { "directory": "{{[^"]*}}workdir", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]}, // CHECK: { "directory": "{{.*}}", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]}, // ERROR: error: compilation database '{{.*}}/non-existant' could not be opened: |