summaryrefslogtreecommitdiffstats
path: root/test/CodeGenOpenCL/blocks.cl
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2019-02-26 16:20:41 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2019-02-26 16:20:41 +0000
commit29e2813a2ab7d5569860bb07892dfef7b5374d96 (patch)
treeaf8c8c532c2fdc0790d5eb43c6872181b7085edf /test/CodeGenOpenCL/blocks.cl
parentd7172a58de051e6b5aa569b47a26b266543b1fb3 (diff)
[OpenCL] Fix assertion due to blocks
A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called. There is code Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee()); getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle BlockExpr and returns nullptr, which causes isa to assert. This patch fixes that. Differential Revision: https://reviews.llvm.org/D58658 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenOpenCL/blocks.cl')
-rw-r--r--test/CodeGenOpenCL/blocks.cl6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/blocks.cl b/test/CodeGenOpenCL/blocks.cl
index ab5a2c643c..c3e26855df 100644
--- a/test/CodeGenOpenCL/blocks.cl
+++ b/test/CodeGenOpenCL/blocks.cl
@@ -90,6 +90,12 @@ int get42() {
return blockArgFunc(^{return 42;});
}
+// COMMON-LABEL: define {{.*}}@call_block
+// call {{.*}}@__call_block_block_invoke
+int call_block() {
+ return ^int(int num) { return num; } (11);
+}
+
// CHECK-DEBUG: !DIDerivedType(tag: DW_TAG_member, name: "__size"
// CHECK-DEBUG: !DIDerivedType(tag: DW_TAG_member, name: "__align"