ingomueller-net created this revision. ingomueller-net added a reviewer: ChuanqiXu. Herald added a project: All. ingomueller-net requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
This patch solves two problems with the recently added test, which caused CI failure in an internal downstream system: 1. It connects subsequent `RUN` statements with `&&` into a single statement; otherwise, the variable defined in the first of them is out of scope in the subsequent ones where it is used. 2. In our hermetic testing environment, the clang++ binary under test does not have access to standard include paths (`/usr/include` etc.), so the test fails because it does not find `stddef.h`. The patch thus changes the test to use a locally created `a.h` header file. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D157817 Files: clang/test/ClangScanDeps/pr61006.cppm Index: clang/test/ClangScanDeps/pr61006.cppm =================================================================== --- clang/test/ClangScanDeps/pr61006.cppm +++ clang/test/ClangScanDeps/pr61006.cppm @@ -6,10 +6,10 @@ // 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: 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 @@ -25,7 +25,7 @@ ] //--- a.cpp -#include <stddef.h> +#include "a.h" import b; // CHECK: { @@ -42,3 +42,5 @@ // CHECK-NEXT: ], // CHECK-NEXT: "version": 1 // CHECK-NEXT: } + +//--- a.h
Index: clang/test/ClangScanDeps/pr61006.cppm =================================================================== --- clang/test/ClangScanDeps/pr61006.cppm +++ clang/test/ClangScanDeps/pr61006.cppm @@ -6,10 +6,10 @@ // 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: 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 @@ -25,7 +25,7 @@ ] //--- a.cpp -#include <stddef.h> +#include "a.h" import b; // CHECK: { @@ -42,3 +42,5 @@ // CHECK-NEXT: ], // CHECK-NEXT: "version": 1 // CHECK-NEXT: } + +//--- a.h
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits