aboutsummaryrefslogtreecommitdiff
path: root/test/Driver
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-09-27 08:14:45 +0000
committerHans Wennborg <hans@hanshq.net>2019-09-27 08:14:45 +0000
commit0f7791ecb9716fb6e5c3493db28b7dcf44a06440 (patch)
treead5cee8dfeab099246f1fe92e8dacf6d55a6ef58 /test/Driver
parent30a86d713662851930f6cf07343aba0dd5836f26 (diff)
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.c4
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: