Skip to content

Commit 28726b9

Browse files
zmodemtstellar
authored andcommitted
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). ------------------------------------------------------------------------
1 parent 5ab44f3 commit 28726b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/test/Driver/compilation_database.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: mkdir -p %t && cd %t
1+
// RUN: mkdir -p %t.workdir && cd %t.workdir
22
// RUN: %clang -MD -MP --sysroot=somewhere -c -x c %s -xc++ %s -Wall -MJ - -no-canonical-prefixes 2>&1 | FileCheck %s
33
// RUN: not %clang -c -x c %s -MJ %s/non-existant -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=ERROR %s
44

5-
// CHECK: { "directory": "{{.*}}", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]},
5+
// CHECK: { "directory": "{{[^"]*}}workdir", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]},
66
// CHECK: { "directory": "{{.*}}", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]},
77
// ERROR: error: compilation database '{{.*}}/non-existant' could not be opened:
88

0 commit comments

Comments
 (0)