[clang] [CodeGen] Fix emission of function pointer casts with non-zero program AS (PR #186210)
Nick Sarnie via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 13 07:19:51 PDT 2026
================
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -triple spirv64-intel %s -emit-llvm -o - | FileCheck %s
+
+// Test that function pointer casts properly handle address space conversions
+// on targets like spirv64-intel that use a non-default program address space.
+
+void foo() {}
+
+// CHECK-LABEL: define spir_func void @_Z21test_func_to_void_ptrv() addrspace(9)
+void test_func_to_void_ptr() {
+ void *ptr = (void*)foo;
+ // CHECK: store ptr addrspace(4) addrspacecast (ptr addrspace(9) @_Z3foov to ptr addrspace(4))
----------------
sarnex wrote:
Thanks for the quick review guys. Do you guys have any other comments? If not I'd appreciate an approval :)
https://github.com/llvm/llvm-project/pull/186210
More information about the cfe-commits
mailing list