@@ -57,3 +57,25 @@ void type_trait_expr() {
5757// OGCG: store i8 0, ptr %[[B_ADDR]], align 1
5858// OGCG: store i8 0, ptr %[[C_ADDR]], align 1
5959// OGCG: store i8 0, ptr %[[D_ADDR]], align 1
60+
61+ void array_type_trait_expr () {
62+ unsigned long a = __array_rank (int [10 ][20 ]);
63+ unsigned long b = __array_extent (int [10 ][20 ], 1 );
64+ }
65+
66+ // CIR: %[[A_ADDR:.*]] = cir.alloca !u64i, !cir.ptr<!u64i>, ["a", init]
67+ // CIR: %[[B_ADDR:.*]] = cir.alloca !u64i, !cir.ptr<!u64i>, ["b", init]
68+ // CIR: %[[CONST_2:.*]] = cir.const #cir.int<2> : !u64i
69+ // CIR: cir.store {{.*}} %[[CONST_2]], %[[A_ADDR]] : !u64i, !cir.ptr<!u64i>
70+ // CIR: %[[CONST_20:.*]] = cir.const #cir.int<20> : !u64i
71+ // CIR: cir.store {{.*}} %[[CONST_20]], %[[B_ADDR]] : !u64i, !cir.ptr<!u64i>
72+
73+ // LLVM: %[[A_ADDR:.*]] = alloca i64, i64 1, align 8
74+ // LLVM: %[[B_ADDR:.*]] = alloca i64, i64 1, align 8
75+ // LLVM: store i64 2, ptr %[[A_ADDR]], align 8
76+ // LLVM: store i64 20, ptr %[[B_ADDR]], align 8
77+
78+ // OGCG: %[[A_ADDR:.*]] = alloca i64, align 8
79+ // OGCG: %[[B_ADDR:.*]] = alloca i64, align 8
80+ // OGCG: store i64 2, ptr %[[A_ADDR]], align 8
81+ // OGCG: store i64 20, ptr %[[B_ADDR]], align 8
0 commit comments