[clang] [CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (PR #135493)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 14 10:04:37 PDT 2025
================
@@ -350,20 +350,87 @@ void func7() {
// OGCG: %[[ARR:.*]] = alloca [1 x ptr], align 8
// OGCG: call void @llvm.memset.p0.i64(ptr align 8 %[[ARR]], i8 0, i64 8, i1 false)
-void func8(int p[10]) {}
-// CIR: cir.func @func8(%arg0: !cir.ptr<!s32i>
-// CIR: cir.alloca !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>, ["p", init]
-
-// LLVM: define void @func8(ptr {{%.*}})
-// LLVM-NEXT: alloca ptr, i64 1, align 8
-
-// OGCG: alloca ptr, align 8
+void func8(int arr[10]) {
----------------
andykaylor wrote:
Can you add a test case where the parameter is a raw pointer. Something like this?
```
void func10(int *a) {
int e = a[5];
}
```
https://github.com/llvm/llvm-project/pull/135493
More information about the cfe-commits
mailing list