| 
19 | 19 | // CIR-DAG: !rec_CycleEnd = !cir.record<struct "CycleEnd" {!cir.ptr<!cir.record<struct "CycleStart" {!cir.ptr<!cir.record<struct "CycleMiddle" {!cir.ptr<!cir.record<struct "CycleEnd">>}>>}>>}>  | 
20 | 20 | // CIR-DAG: !rec_CycleMiddle = !cir.record<struct "CycleMiddle" {!cir.ptr<!rec_CycleEnd>}>  | 
21 | 21 | // CIR-DAG: !rec_CycleStart = !cir.record<struct "CycleStart" {!cir.ptr<!rec_CycleMiddle>}>  | 
 | 22 | +// CIR-DAG: !rec_IncompleteArray = !cir.record<struct "IncompleteArray" {!cir.array<!s32i x 0>}>  | 
22 | 23 | // LLVM-DAG: %struct.CompleteS = type { i32, i8 }  | 
23 | 24 | // LLVM-DAG: %struct.OuterS = type { %struct.InnerS, i32 }  | 
24 | 25 | // LLVM-DAG: %struct.InnerS = type { i32, i8 }  | 
 | 
30 | 31 | // LLVM-DAG: %struct.CycleStart = type { ptr }  | 
31 | 32 | // LLVM-DAG: %struct.CycleMiddle = type { ptr }  | 
32 | 33 | // LLVM-DAG: %struct.CycleEnd = type { ptr }  | 
 | 34 | +// LLVM-DAG: %struct.IncompleteArray = type { [0 x i32] }  | 
33 | 35 | // OGCG-DAG: %struct.CompleteS = type { i32, i8 }  | 
34 | 36 | // OGCG-DAG: %struct.OuterS = type { %struct.InnerS, i32 }  | 
35 | 37 | // OGCG-DAG: %struct.InnerS = type { i32, i8 }  | 
 | 
41 | 43 | // OGCG-DAG: %struct.CycleStart = type { ptr }  | 
42 | 44 | // OGCG-DAG: %struct.CycleMiddle = type { ptr }  | 
43 | 45 | // OGCG-DAG: %struct.CycleEnd = type { ptr }  | 
 | 46 | +// OGCG-DAG: %struct.IncompleteArray = type { [0 x i32] }  | 
44 | 47 | 
 
  | 
45 | 48 | struct CompleteS {  | 
46 | 49 |   int a;  | 
@@ -149,6 +152,16 @@ struct CycleEnd {  | 
149 | 152 | // LLVM-DAG:  @end = global %struct.CycleEnd zeroinitializer  | 
150 | 153 | // OGCG-DAG:  @end = global %struct.CycleEnd zeroinitializer  | 
151 | 154 | 
 
  | 
 | 155 | +struct IncompleteArray {  | 
 | 156 | +  int array[];  | 
 | 157 | +} incomplete;  | 
 | 158 | + | 
 | 159 | +// CIR: cir.global external @incomplete = #cir.zero : !rec_IncompleteArray  | 
 | 160 | + | 
 | 161 | +// LLVM-DAG: global %struct.IncompleteArray zeroinitializer  | 
 | 162 | + | 
 | 163 | +// OGCG-DAG: global %struct.IncompleteArray zeroinitializer  | 
 | 164 | + | 
152 | 165 | void f(void) {  | 
153 | 166 |   struct IncompleteS *p;  | 
154 | 167 | }  | 
@@ -313,3 +326,4 @@ void f6(struct CycleStart *start) {  | 
313 | 326 | // OGCG:   %[[MIDDLE:.*]] = getelementptr inbounds nuw %struct.CycleStart, ptr %{{.*}}, i32 0, i32 0  | 
314 | 327 | // OGCG:   %[[END:.*]] = getelementptr inbounds nuw %struct.CycleMiddle, ptr %{{.*}}, i32 0, i32 0  | 
315 | 328 | // OGCG:   %[[START2:.*]] = getelementptr inbounds nuw %struct.CycleEnd, ptr %{{.*}}, i32 0, i32 0  | 
 | 329 | + | 
0 commit comments