[clang] [clang] test should not depend on system header (PR #119903)
Yuxuan Chen via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 13 09:35:07 PST 2024
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/119903
>From 449459edf130c842d57b672799927f158f0b92cb Mon Sep 17 00:00:00 2001
From: Yuxuan Chen <yuxuanchen1997 at outlook.com>
Date: Fri, 13 Dec 2024 09:09:14 -0800
Subject: [PATCH] [clang] test should not depend on system header
---
clang/test/Interpreter/Inputs/vector | 10 ++++++++++
clang/test/Interpreter/crash.cpp | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 clang/test/Interpreter/Inputs/vector
diff --git a/clang/test/Interpreter/Inputs/vector b/clang/test/Interpreter/Inputs/vector
new file mode 100644
index 00000000000000..4fc5d04f4718c7
--- /dev/null
+++ b/clang/test/Interpreter/Inputs/vector
@@ -0,0 +1,10 @@
+#ifndef VECTOR
+#define VECTOR
+namespace std {
+template <typename>
+class vector {
+public:
+ vector();
+};
+} // namespace std
+#endif // VECTOR
diff --git a/clang/test/Interpreter/crash.cpp b/clang/test/Interpreter/crash.cpp
index 1ab24b0febfa15..9a606983524d82 100644
--- a/clang/test/Interpreter/crash.cpp
+++ b/clang/test/Interpreter/crash.cpp
@@ -5,7 +5,7 @@
//
// RUN: split-file %s %t
//
-// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o
+// RUN: %clang++ -Xclang -nostdsysteminc -I%S/Inputs/ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o
// RUN: %clang++ -shared %t/vec.o -o %t/vec.so
//
// RUN: cat %t/Test.cpp | LD_LIBRARY_PATH=%t:$LD_LIBRARY_PATH clang-repl
More information about the cfe-commits
mailing list