================ @@ -29,8 +29,15 @@ int f[5] = {1, 2}; void func() { int arr[10]; - // CHECK: %[[ARR:.*]] = cir.alloca !cir.array<!s32i x 10>, !cir.ptr<!cir.array<!s32i x 10>>, ["arr"] + + int e = arr[1]; + // CHECK: %[[INIT:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["e", init] + // CHECK: %[[IDX:.*]] = cir.const #cir.int<1> : !s32i + // CHECK: %[[ARR_PTR:.*]] = cir.cast(array_to_ptrdecay, %[[ARR]] : !cir.ptr<!cir.array<!s32i x 10>>), !cir.ptr<!s32i> + // CHECK: %[[ELE_PTR:.*]] = cir.ptr_stride(%[[ARR_PTR]] : !cir.ptr<!s32i>, %[[IDX]] : !s32i), !cir.ptr<!s32i> + // CHECK: %[[TMP:.*]] = cir.load %[[ELE_PTR]] : !cir.ptr<!s32i>, !s32i + // CHECK" cir.store %[[TMP]], %[[INIT]] : !s32i, !cir.ptr<!s32i> ---------------- andykaylor wrote:
I think eventually we could get rid of all the `lowering` tests, but we'd need to make sure what they are testing is fully covered in the `codegen` tests. @bcardosolopes @lanza Does this seem reasonable to you? Would it create problems for rebasing the incubator? https://github.com/llvm/llvm-project/pull/134536 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits