[PATCH] D130768: [OpenCL][SPIR-V] Add test for extern functions with a pointer

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 29 05:58:02 PDT 2022


Anastasia created this revision.
Anastasia added reviewers: svenvh, iliya-diyachkov.
Herald added subscribers: ebevhan, yaxunl.
Herald added a project: All.
Anastasia requested review of this revision.

I would like to add this test case that enhances coverage of opaque pointers particularly for the problematic case with `extern` functions for which there is no solution found yet.


https://reviews.llvm.org/D130768

Files:
  clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl


Index: clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
===================================================================
--- /dev/null
+++ clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple spirv64 %s | FileCheck %s
+
+// Check that we have a way to recover pointer
+// types for extern function prototypes (see PR56660).
+extern void foo(global int * ptr);
+kernel void k(global int * ptr) {
+  foo(ptr);
+}
+//CHECK: define spir_kernel void @k(i32 {{.*}}*
+//CHECK: declare spir_func void @foo(i32 {{.*}}*


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130768.448602.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220729/f7b6721d/attachment.bin>


More information about the cfe-commits mailing list