11 #ifdef LIBCOPP_MACRO_USE_SEGMENTED_STACKS
13 typedef copp::coroutine_context_container<copp::allocator::stack_allocator_split_segment> test_split_segment_context;
15 class test_split_segment_foo_runner {
17 void stack_test(
int loop) {
19 char b[1024 * 1024] = {0};
22 end_addr_ = (intptr_t)(&c);
23 if (loop > 0) stack_test(loop - 1);
27 int operator()(
void *) {
29 begin_addr_ = (intptr_t)(&a);
30 end_addr_ = begin_addr_;
34 copp::this_coroutine::get<test_split_segment_context>()->yield();
44 CASE_TEST(coroutine, context_split_segment_stack) {
45 test_split_segment_foo_runner runner;
47 test_split_segment_context::ptr_t co = test_split_segment_context::create(&runner, 2 * 1024 * 1024);
52 intptr_t dis = (runner.end_addr_ > runner.begin_addr_) ? (runner.end_addr_ - runner.begin_addr_)
53 : (runner.begin_addr_ - runner.end_addr_);
#define CASE_TEST(test_name, case_name)
#define CASE_EXPECT_TRUE(c)
#define CASE_EXPECT_GE(l, r)