Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-interp] Use -fno-sized-deallocation in two tests #95546

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

nico
Copy link
Contributor

@nico nico commented Jun 14, 2024

At least on my Windows machine, these two tests fail due to not being able to look up ??3@YAXPEAX_K@Z (which is
void __cdecl operator delete(void *, unsigned __int64) in demangled) after 130e93c. Since they don't test anything related to sized deallocation, just disable sized allocation for them.

Possibly fixes #95451.

At least on my Windows machine, these two tests fail due to not
being able to look up `??3@YAXPEAX_K@Z` (which is
`void __cdecl operator delete(void *, unsigned __int64)` in demangled)
after 130e93c. Since they don't test anything related to sized
deallocation, just disable sized allocation for them.

Possibly fixes llvm#95451.
@nico nico requested review from zmodem and wangpc-pp June 14, 2024 13:44
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jun 14, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 14, 2024

@llvm/pr-subscribers-clang

Author: Nico Weber (nico)

Changes

At least on my Windows machine, these two tests fail due to not being able to look up ??3@<!-- -->YAXPEAX_K@<!-- -->Z (which is
void __cdecl operator delete(void *, unsigned __int64) in demangled) after 130e93c. Since they don't test anything related to sized deallocation, just disable sized allocation for them.

Possibly fixes #95451.


Full diff: https://github.com/llvm/llvm-project/pull/95546.diff

2 Files Affected:

  • (modified) clang/test/Interpreter/inline-virtual.cpp (+4-2)
  • (modified) clang/unittests/Interpreter/InterpreterTest.cpp (+2-1)
diff --git a/clang/test/Interpreter/inline-virtual.cpp b/clang/test/Interpreter/inline-virtual.cpp
index d862b3354f61f..9c31208a4a642 100644
--- a/clang/test/Interpreter/inline-virtual.cpp
+++ b/clang/test/Interpreter/inline-virtual.cpp
@@ -3,8 +3,10 @@
 //
 // We disable RTTI to avoid problems on Windows for non-RTTI builds of LLVM
 // where the JIT cannot find ??_7type_info@@6B@.
-// RUN: cat %s | clang-repl -Xcc -fno-rtti | FileCheck %s
-// RUN: cat %s | clang-repl -Xcc -fno-rtti -Xcc -O2 | FileCheck %s
+// RUN: cat %s | clang-repl -Xcc -fno-rtti -Xcc -fno-sized-deallocation \
+// RUN:     | FileCheck %s
+// RUN: cat %s | clang-repl -Xcc -fno-rtti -Xcc -fno-sized-deallocation \
+// RUN:     -Xcc -O2 | FileCheck %s
 
 extern "C" int printf(const char *, ...);
 
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index 683295a18d519..bbd854149d5f5 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -286,7 +286,8 @@ TEST_F(InterpreterTest, InstantiateTemplate) {
 // https://github.com/llvm/llvm-project/issues/94994.
 #ifndef __arm__
 TEST_F(InterpreterTest, Value) {
-  std::unique_ptr<Interpreter> Interp = createInterpreter();
+  std::vector<const char *> Args = {"-fno-sized-deallocation"};
+  std::unique_ptr<Interpreter> Interp = createInterpreter(Args);
 
   Value V1;
   llvm::cantFail(Interp->ParseAndExecute("int x = 42;"));

@nico
Copy link
Contributor Author

nico commented Jun 14, 2024

Merging to green up tests on a bot. Happy to address post-commit comments in a follow-up 🙂

@nico nico merged commit c63b9a5 into llvm:main Jun 14, 2024
7 of 8 checks passed
@nico nico deleted the win-interp branch June 14, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some clang interpreter tests are failing on Windows if vcvarsall isn't run
2 participants