[clang] [analyzer] Retain address space information in getElementRegion (PR #151370)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 31 03:09:05 PDT 2025
================
@@ -0,0 +1,11 @@
+// RUN: %clang_analyze_cc1 -triple amdgcn-unknown-unknown \
+// RUN: -analyzer-checker=core,unix.Malloc -verify %s
+
+// expected-no-diagnostics
+//
+// By default, pointers are 64-bits.
+#define ADDRESS_SPACE_32BITS __attribute__((address_space(3)))
+
+int test(ADDRESS_SPACE_32BITS int *p, ADDRESS_SPACE_32BITS void *q) {
+ return p == q;
----------------
steakhal wrote:
```suggestion
return p == q; // no-crash
```
https://github.com/llvm/llvm-project/pull/151370
More information about the cfe-commits
mailing list