Author: Hans Wennborg Date: 2019-11-12T16:00:18-08:00 New Revision: 28726b909b997f42bd42fa3e14073f2e491aa2a5
URL: https://github.com/llvm/llvm-project/commit/28726b909b997f42bd42fa3e14073f2e491aa2a5 DIFF: https://github.com/llvm/llvm-project/commit/28726b909b997f42bd42fa3e14073f2e491aa2a5.diff LOG: 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). ------------------------------------------------------------------------ Added: Modified: clang/test/Driver/compilation_database.c Removed: ################################################################################ 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: _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits