Author: Anastasia Stulova
Date: 2022-09-01T10:22:47+01:00
New Revision: 6b1a04529c8fba4019b3a7f56fe6e4938f3a188a

URL: 
https://github.com/llvm/llvm-project/commit/6b1a04529c8fba4019b3a7f56fe6e4938f3a188a
DIFF: 
https://github.com/llvm/llvm-project/commit/6b1a04529c8fba4019b3a7f56fe6e4938f3a188a.diff

LOG: [OpenCL][SPIR-V] Test extern functions with a pointer arg.

Added a test case that enhances coverage of opaque pointers
particularly for the problematic case with extern functions
for which there is no solution found for type recovery.

Differential Revision: https://reviews.llvm.org/D130768

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl 
b/clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
new file mode 100644
index 000000000000..93220ef98f18
--- /dev/null
+++ b/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 {{.*}}*


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to