Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8ab6912

Browse files
authoredDec 13, 2024··
[Clang] Interpreter test should not depend on system header (#119903)
30ad53b introduced a new test that includes `<vector>` from the system include path without honoring environment variables that may provide the path to C++ standard library. This is not supported in some CI systems because we don't always have the C++ library in the standard location. The conventional way of doing includes in the test is through `Inputs` directory and pass it as an include path. The `vector` file included in this patch has been shortened, but I have verified that it works with this test. i.e. the clang repl crashes on this test in the same way if the fix in #117475 is reverted.
1 parent 52e9f2c commit 8ab6912

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
 

‎clang/test/Interpreter/Inputs/vector

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef VECTOR
2+
#define VECTOR
3+
namespace std {
4+
template <typename>
5+
class vector {
6+
public:
7+
vector();
8+
};
9+
} // namespace std
10+
#endif // VECTOR

‎clang/test/Interpreter/crash.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// RUN: split-file %s %t
77
//
8-
// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o
8+
// RUN: %clang++ -Xclang -nostdsysteminc -I%S/Inputs/ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o
99
// RUN: %clang++ -shared %t/vec.o -o %t/vec.so
1010
//
1111
// RUN: cat %t/Test.cpp | LD_LIBRARY_PATH=%t:$LD_LIBRARY_PATH clang-repl

0 commit comments

Comments
 (0)
Please sign in to comment.