Skip to content

Commit bb13b49

Browse files
authored
Merge branch 'main' into Update-to-llvm-20
2 parents 6e1a9ff + ddd67a2 commit bb13b49

File tree

7 files changed

+67
-35
lines changed

7 files changed

+67
-35
lines changed

.github/workflows/clang-tidy-review-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Post review comments
2323
id: post-review
24-
uses: ZedThree/clang-tidy-review/post@v0.20.1
24+
uses: ZedThree/clang-tidy-review/post@v0.21.0
2525
with:
2626
max_comments: 10
2727

.github/workflows/clang-tidy-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pip install lit
3232

3333
- name: Run clang-tidy
34-
uses: ZedThree/clang-tidy-review@v0.20.1
34+
uses: ZedThree/clang-tidy-review@v0.21.0
3535
id: review
3636
with:
3737
build_dir: build
@@ -47,4 +47,4 @@ jobs:
4747
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
4848
4949
- name: Upload artifacts
50-
uses: ZedThree/clang-tidy-review/upload@v0.20.1
50+
uses: ZedThree/clang-tidy-review/upload@v0.21.0

.github/workflows/stale-pr-and-issues.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

cmake/modules/GoogleTest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ExternalProject_Add(
3131
googletest
3232
GIT_REPOSITORY https://github.com/google/googletest.git
3333
GIT_SHALLOW 1
34-
GIT_TAG v1.15.2
34+
GIT_TAG v1.16.0
3535
UPDATE_COMMAND ""
3636
# # Force separate output paths for debug and release builds to allow easy
3737
# # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands

environment-wasm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ channels:
33
- https://repo.prefix.dev/emscripten-forge-dev
44
dependencies:
55
- emscripten-abi==3.1.73
6-
- nlohmann_json
6+
- nlohmann_json=3.11.3
77
- xeus-lite
88
- xeus
99
- cpp-argparse
1010
- pugixml
11-
- doctest
11+
- doctest

lib/Interpreter/CppInterOpInterpreter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Interpreter {
167167
return inner->getCompilerInstance();
168168
}
169169

170-
const llvm::orc::LLJIT* getExecutionEngine() const {
170+
llvm::orc::LLJIT* getExecutionEngine() const {
171171
return compat::getExecutionEngine(*inner);
172172
}
173173

unittests/CppInterOp/FunctionReflectionTest.cpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,66 @@ TEST(FunctionReflectionTest, Construct) {
17661766
clang_Interpreter_dispose(I);
17671767
}
17681768

1769+
// Test nested constructor calls
1770+
TEST(FunctionReflectionTest, ConstructNested) {
1771+
#ifdef EMSCRIPTEN
1772+
GTEST_SKIP() << "Test fails for Emscipten builds";
1773+
#endif
1774+
if (llvm::sys::RunningOnValgrind())
1775+
GTEST_SKIP() << "XFAIL due to Valgrind report";
1776+
#ifdef _WIN32
1777+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
1778+
#endif
1779+
1780+
Cpp::CreateInterpreter();
1781+
1782+
Interp->declare(R"(
1783+
#include <new>
1784+
extern "C" int printf(const char*,...);
1785+
class A {
1786+
public:
1787+
int a_val;
1788+
A() : a_val(7) {
1789+
printf("A Constructor Called\n");
1790+
}
1791+
};
1792+
1793+
class B {
1794+
public:
1795+
A a;
1796+
int b_val;
1797+
B() : b_val(99) {
1798+
printf("B Constructor Called\n");
1799+
}
1800+
};
1801+
)");
1802+
1803+
testing::internal::CaptureStdout();
1804+
Cpp::TCppScope_t scope_A = Cpp::GetNamed("A");
1805+
Cpp::TCppScope_t scope_B = Cpp::GetNamed("B");
1806+
Cpp::TCppObject_t object = Cpp::Construct(scope_B);
1807+
EXPECT_TRUE(object != nullptr);
1808+
std::string output = testing::internal::GetCapturedStdout();
1809+
EXPECT_EQ(output, "A Constructor Called\nB Constructor Called\n");
1810+
output.clear();
1811+
1812+
// In-memory construction
1813+
testing::internal::CaptureStdout();
1814+
void* arena = Cpp::Allocate(scope_B);
1815+
EXPECT_TRUE(arena == Cpp::Construct(scope_B, arena));
1816+
1817+
// Check if both integers a_val and b_val were set.
1818+
EXPECT_EQ(*(int*)arena, 7);
1819+
size_t a_size = Cpp::SizeOf(scope_A);
1820+
int* b_val_ptr =
1821+
reinterpret_cast<int*>(reinterpret_cast<char*>(arena) + a_size);
1822+
EXPECT_EQ(*b_val_ptr, 99);
1823+
Cpp::Deallocate(scope_B, arena);
1824+
output = testing::internal::GetCapturedStdout();
1825+
EXPECT_EQ(output, "A Constructor Called\nB Constructor Called\n");
1826+
output.clear();
1827+
}
1828+
17691829
TEST(FunctionReflectionTest, Destruct) {
17701830
#ifdef EMSCRIPTEN
17711831
GTEST_SKIP() << "Test fails for Emscipten builds";

0 commit comments

Comments
 (0)