[clang] [CIR] Convert null pointer constant types in target lowering (PR #228068)

Arseniy Obolenskiy via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 00:35:37 PDT 2026


================
@@ -71,3 +71,11 @@ generic_int *cast_and_global(global_int *ptr) {
 // POST: cir.cast address_space
 // POST-SAME: !cir.ptr<!s32i, target_address_space(1)>
 // POST-SAME: !cir.ptr<!s32i, target_address_space(4)>
+
+generic_int *null_generic() { return nullptr; }
+
+// PRE-LABEL: cir.func {{.*}} @_Z12null_genericv
+// PRE: cir.const #cir.ptr<null> : !cir.ptr<!s32i, lang_address_space(offload_generic)>
+
+// POST-LABEL: cir.func {{.*}} @_Z12null_genericv
+// POST: cir.const #cir.ptr<null> : !cir.ptr<!s32i, target_address_space(4)>
----------------
aobolensk wrote:

No, this part is common, added common test as well

https://github.com/llvm/llvm-project/pull/228068


More information about the cfe-commits mailing list