forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DependencyScanningFilesystem] Make sure the local/shared cache filen…
…ame lookups use only absolute paths (llvm#66122) Previously a relative path would be used as a key for cache lookup and if the same relative path was used from another compiler invocation with a different working directory then the first cache entry was erroneously returned. (cherry picked from commit 36b37c7)
- Loading branch information
Showing
3 changed files
with
117 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// RUN: rm -rf %t | ||
// RUN: split-file %s %t | ||
// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json | ||
|
||
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format make -j 1 > %t/result.txt | ||
// RUN: FileCheck %s -input-file=%t/result.txt | ||
|
||
// CHECK: {{/|\\}}dir1{{/|\\}}t1.c | ||
// CHECK: {{/|\\}}dir1{{/|\\}}head.h | ||
// CHECK: {{/|\\}}dir2{{/|\\}}t2.c | ||
// CHECK: {{/|\\}}dir2{{/|\\}}head.h | ||
|
||
//--- cdb.json.template | ||
[ | ||
{ | ||
"directory": "DIR/dir1", | ||
"command": "clang -fsyntax-only t1.c", | ||
"file": "t1.c" | ||
}, | ||
{ | ||
"directory": "DIR/dir2", | ||
"command": "clang -fsyntax-only t2.c", | ||
"file": "t2.c" | ||
} | ||
] | ||
|
||
//--- dir1/t1.c | ||
#include "head.h" | ||
|
||
//--- dir1/head.h | ||
#ifndef BBB | ||
#define BBB | ||
#endif | ||
|
||
//--- dir2/t2.c | ||
#include "head.h" | ||
|
||
//--- dir2/head.h |