summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-09-27 08:14:45 +0000
committerTom Stellard <tstellar@redhat.com>2019-11-12 16:00:18 -0800
commit28726b909b997f42bd42fa3e14073f2e491aa2a5 (patch)
treee03ef38725eb379ddf7604ed9f0a2dd2553ab71d
parent5ab44f3ec15f2be1e244c1b565381e0011985365 (diff)
downloadllvm-28726b909b997f42bd42fa3e14073f2e491aa2a5.tar.gz
Merging r373049:
------------------------------------------------------------------------ r373049 | hans | 2019-09-27 01:14:45 -0700 (Fri, 27 Sep 2019) | 4 lines 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). ------------------------------------------------------------------------
-rw-r--r--clang/test/Driver/compilation_database.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Driver/compilation_database.c b/clang/test/Driver/compilation_database.c
index 017178d60cde..343b76aa44f3 100644
--- a/clang/test/Driver/compilation_database.c
+++ b/clang/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: