summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCoroutines/coro-params.cpp
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2018-02-15 20:37:22 +0000
committerBrian Gesiak <modocache@gmail.com>2018-02-15 20:37:22 +0000
commit986062219fd2600835229f36496bb4ec7ee52b38 (patch)
treeaa19f7cfd9fed1cfc291dd2c7bc78685ea2875ec /clang/test/CodeGenCoroutines/coro-params.cpp
parentf3f35efe5c911e7dd51c58a92b073806a8909a3a (diff)
downloadbcm5719-llvm-986062219fd2600835229f36496bb4ec7ee52b38.tar.gz
bcm5719-llvm-986062219fd2600835229f36496bb4ec7ee52b38.zip
[Coroutines] Use allocator overload when available
Summary: Depends on https://reviews.llvm.org/D42605. An implementation of the behavior described in `[dcl.fct.def.coroutine]/7`: when a promise type overloads `operator new` using a "placement new" that takes the same argument types as the coroutine function, that overload is used when allocating the coroutine frame. Simply passing references to the coroutine function parameters directly to `operator new` results in invariant violations in LLVM's coroutine splitting pass, so this implementation modifies Clang codegen to produce allocator-specific alloc/store/loads for each parameter being forwarded to the allocator. Test Plan: `check-clang` Reviewers: rsmith, GorNishanov, eric_niebler Reviewed By: GorNishanov Subscribers: lewissbaker, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D42606 llvm-svn: 325291
Diffstat (limited to 'clang/test/CodeGenCoroutines/coro-params.cpp')
-rw-r--r--clang/test/CodeGenCoroutines/coro-params.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/test/CodeGenCoroutines/coro-params.cpp b/clang/test/CodeGenCoroutines/coro-params.cpp
index 45b8aeffd11..078d7eeb7bc 100644
--- a/clang/test/CodeGenCoroutines/coro-params.cpp
+++ b/clang/test/CodeGenCoroutines/coro-params.cpp
@@ -69,12 +69,12 @@ void f(int val, MoveOnly moParam, MoveAndCopy mcParam) {
// CHECK: store i32 %val, i32* %[[ValAddr:.+]]
// CHECK: call i8* @llvm.coro.begin(
- // CHECK-NEXT: call void @_ZN8MoveOnlyC1EOS_(%struct.MoveOnly* %[[MoCopy]], %struct.MoveOnly* dereferenceable(4) %[[MoParam]])
+ // CHECK: call void @_ZN8MoveOnlyC1EOS_(%struct.MoveOnly* %[[MoCopy]], %struct.MoveOnly* dereferenceable(4) %[[MoParam]])
// CHECK-NEXT: call void @_ZN11MoveAndCopyC1EOS_(%struct.MoveAndCopy* %[[McCopy]], %struct.MoveAndCopy* dereferenceable(4) %[[McParam]]) #
// CHECK-NEXT: invoke void @_ZNSt12experimental16coroutine_traitsIJvi8MoveOnly11MoveAndCopyEE12promise_typeC1Ev(
// CHECK: call void @_ZN14suspend_always12await_resumeEv(
- // CHECK: %[[IntParam:.+]] = load i32, i32* %val.addr
+ // CHECK: %[[IntParam:.+]] = load i32, i32* %val1
// CHECK: %[[MoGep:.+]] = getelementptr inbounds %struct.MoveOnly, %struct.MoveOnly* %[[MoCopy]], i32 0, i32 0
// CHECK: %[[MoVal:.+]] = load i32, i32* %[[MoGep]]
// CHECK: %[[McGep:.+]] = getelementptr inbounds %struct.MoveAndCopy, %struct.MoveAndCopy* %[[McCopy]], i32 0, i32 0
@@ -150,9 +150,9 @@ struct std::experimental::coroutine_traits<void, promise_matching_constructor, i
// CHECK-LABEL: void @_Z38coroutine_matching_promise_constructor28promise_matching_constructorifd(i32, float, double)
void coroutine_matching_promise_constructor(promise_matching_constructor, int, float, double) {
- // CHECK: %[[INT:.+]] = load i32, i32* %.addr, align 4
- // CHECK: %[[FLOAT:.+]] = load float, float* %.addr1, align 4
- // CHECK: %[[DOUBLE:.+]] = load double, double* %.addr2, align 8
+ // CHECK: %[[INT:.+]] = load i32, i32* %5, align 4
+ // CHECK: %[[FLOAT:.+]] = load float, float* %6, align 4
+ // CHECK: %[[DOUBLE:.+]] = load double, double* %7, align 8
// CHECK: invoke void @_ZNSt12experimental16coroutine_traitsIJv28promise_matching_constructorifdEE12promise_typeC1ES1_ifd(%"struct.std::experimental::coroutine_traits<void, promise_matching_constructor, int, float, double>::promise_type"* %__promise, i32 %[[INT]], float %[[FLOAT]], double %[[DOUBLE]])
co_return;
}
OpenPOWER on IntegriCloud