-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NFC] Document the solution to pr61006 and a test for it
Address #61006. The actual reason for the issue is about the usage of clang-scan-deps instead of its functionalities since clang-scan-deps has already considered the problem before for clang modules. So this patch tries to document the corresponding solution and add a test case for it to address the issue.
- Loading branch information
1 parent
63afb70
commit f6b94e0
Showing
2 changed files
with
70 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// The slash direction in linux and windows are different. | ||
// Also the command to create symbolic link is different. | ||
// UNSUPPORTED: system-windows | ||
// | ||
// RUN: rm -fr %t | ||
// RUN: mkdir -p %t | ||
// RUN: split-file %s %t | ||
// | ||
// RUN: EXPECTED_RESOURCE_DIR=`%clang -print-resource-dir` | ||
// RUN: ln -s %clang++ %t/clang++ | ||
// RUN: sed "s|EXPECTED_RESOURCE_DIR|$EXPECTED_RESOURCE_DIR|g; s|DIR|%/t|g" %t/P1689.json.in > %t/P1689.json | ||
// RUN: clang-scan-deps -compilation-database %t/P1689.json -format=p1689 | FileCheck %t/a.cpp -DPREFIX=%/t | ||
// RUN: clang-scan-deps -format=p1689 \ | ||
// RUN: -- %t/clang++ -std=c++20 -c -fprebuilt-module-path=%t %t/a.cpp -o %t/a.o \ | ||
// RUN: -resource-dir $EXPECTED_RESOURCE_DIR | FileCheck %t/a.cpp -DPREFIX=%/t | ||
|
||
//--- P1689.json.in | ||
[ | ||
{ | ||
"directory": "DIR", | ||
"command": "DIR/clang++ -std=c++20 -c -fprebuilt-module-path=DIR DIR/a.cpp -o DIR/a.o -resource-dir EXPECTED_RESOURCE_DIR", | ||
"file": "DIR/a.cpp", | ||
"output": "DIR/a.o" | ||
} | ||
] | ||
|
||
//--- a.cpp | ||
#include <stddef.h> | ||
import b; | ||
|
||
// CHECK: { | ||
// CHECK-NEXT: "revision": 0, | ||
// CHECK-NEXT: "rules": [ | ||
// CHECK-NEXT: { | ||
// CHECK-NEXT: "primary-output": "[[PREFIX]]/a.o", | ||
// CHECK-NEXT: "requires": [ | ||
// CHECK-NEXT: { | ||
// CHECK-NEXT: "logical-name": "b" | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: ] | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: ], | ||
// CHECK-NEXT: "version": 1 | ||
// CHECK-NEXT: } |