diff options
author | Sam McCall <sam.mccall@gmail.com> | 2016-12-07 09:19:07 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2016-12-07 09:19:07 +0000 |
commit | 2e70037cfe544654fd596c4d1b79260766d4be7f (patch) | |
tree | b74b16d3d3c2e045ce9c1b82d24b89f08c4cc21d /test/Driver/compilation_database.c | |
parent | 16b3722621689bbb8183d7022cefddc483e34767 (diff) | |
download | clang-2e70037cfe544654fd596c4d1b79260766d4be7f.tar.gz |
Compilation database test: don't try to output to CWD
Summary:
Write output from compilation database test to %T rather than the working dir.
Sometimes CWD isn't writable!
Also specify no-canonical-prefixes so that clang has 'clang' in the name.
Reviewers: bkramer
Subscribers: joerg, cfe-commits
Differential Revision: https://reviews.llvm.org/D27504
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/compilation_database.c')
-rw-r--r-- | test/Driver/compilation_database.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/Driver/compilation_database.c b/test/Driver/compilation_database.c index 89c76d6b2b..d5bafd41a6 100644 --- a/test/Driver/compilation_database.c +++ b/test/Driver/compilation_database.c @@ -1,8 +1,9 @@ -// RUN: %clang -MD -MP --sysroot=somewhere -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s -// RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s +// RUN: cd "%T" +// 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": "[[CWD:[^"]+]]", "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall",{{.*}} "--target={{[^"]+}}"]}, -// CHECK: { "directory": "[[CWD:[^"]+]]", "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={{[^"]+}}"]}, +// 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: int main(void) { |