@@ -258,7 +258,7 @@ subroutine test_allocatable()
258
258
! CHECK: %[[TYPE_DESC_P1_CAST:.*]] = fir.convert %[[TYPE_DESC_P1]] : (!fir.tdesc<!fir.type<_QMpolyTp1{a:i32,b:i32}>>) -> !fir.ref<none>
259
259
! CHECK: %[[RANK:.*]] = arith.constant 0 : i32
260
260
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
261
- ! CHECK: fir.call @_FortranAAllocatableInitDerived (%[[P_CAST]], %[[TYPE_DESC_P1_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
261
+ ! CHECK: fir.call @_FortranAAllocatableInitDerivedForAllocate (%[[P_CAST]], %[[TYPE_DESC_P1_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
262
262
! CHECK: %[[P_CAST:.*]] = fir.convert %[[P]] : (!fir.ref<!fir.class<!fir.heap<!fir.type<_QMpolyTp1{a:i32,b:i32}>>>>) -> !fir.ref<!fir.box<none>>
263
263
! CHECK: %{{.*}} = fir.call @_FortranAAllocatableAllocate(%[[P_CAST]], %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, i1, !fir.box<none>, !fir.ref<i8>, i32) -> i32
264
264
@@ -267,7 +267,7 @@ subroutine test_allocatable()
267
267
! CHECK: %[[TYPE_DESC_P1_CAST:.*]] = fir.convert %[[TYPE_DESC_P1]] : (!fir.tdesc<!fir.type<_QMpolyTp1{a:i32,b:i32}>>) -> !fir.ref<none>
268
268
! CHECK: %[[RANK:.*]] = arith.constant 0 : i32
269
269
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
270
- ! CHECK: fir.call @_FortranAAllocatableInitDerived (%[[C1_CAST]], %[[TYPE_DESC_P1_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
270
+ ! CHECK: fir.call @_FortranAAllocatableInitDerivedForAllocate (%[[C1_CAST]], %[[TYPE_DESC_P1_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
271
271
! CHECK: %[[C1_CAST:.*]] = fir.convert %[[C1]] : (!fir.ref<!fir.class<!fir.heap<!fir.type<_QMpolyTp1{a:i32,b:i32}>>>>) -> !fir.ref<!fir.box<none>>
272
272
! CHECK: %{{.*}} = fir.call @_FortranAAllocatableAllocate(%[[C1_CAST]], %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, i1, !fir.box<none>, !fir.ref<i8>, i32) -> i32
273
273
@@ -276,7 +276,7 @@ subroutine test_allocatable()
276
276
! CHECK: %[[TYPE_DESC_P2_CAST:.*]] = fir.convert %[[TYPE_DESC_P2]] : (!fir.tdesc<!fir.type<_QMpolyTp2{a:i32,b:i32,c:i32}>>) -> !fir.ref<none>
277
277
! CHECK: %[[RANK:.*]] = arith.constant 0 : i32
278
278
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
279
- ! CHECK: fir.call @_FortranAAllocatableInitDerived (%[[C2_CAST]], %[[TYPE_DESC_P2_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
279
+ ! CHECK: fir.call @_FortranAAllocatableInitDerivedForAllocate (%[[C2_CAST]], %[[TYPE_DESC_P2_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
280
280
! CHECK: %[[C2_CAST:.*]] = fir.convert %[[C2]] : (!fir.ref<!fir.class<!fir.heap<!fir.type<_QMpolyTp1{a:i32,b:i32}>>>>) -> !fir.ref<!fir.box<none>>
281
281
! CHECK: %{{.*}} = fir.call @_FortranAAllocatableAllocate(%[[C2_CAST]], %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {{.*}}: (!fir.ref<!fir.box<none>>, i1, !fir.box<none>, !fir.ref<i8>, i32) -> i32
282
282
@@ -285,7 +285,7 @@ subroutine test_allocatable()
285
285
! CHECK: %[[TYPE_DESC_P1_CAST:.*]] = fir.convert %[[TYPE_DESC_P1]] : (!fir.tdesc<!fir.type<_QMpolyTp1{a:i32,b:i32}>>) -> !fir.ref<none>
286
286
! CHECK: %[[RANK:.*]] = arith.constant 1 : i32
287
287
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
288
- ! CHECK: fir.call @_FortranAAllocatableInitDerived (%[[C3_CAST]], %[[TYPE_DESC_P1_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
288
+ ! CHECK: fir.call @_FortranAAllocatableInitDerivedForAllocate (%[[C3_CAST]], %[[TYPE_DESC_P1_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
289
289
! CHECK: %[[C10:.*]] = arith.constant 10 : i32
290
290
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
291
291
! CHECK: %[[C3_CAST:.*]] = fir.convert %[[C3]] : (!fir.ref<!fir.class<!fir.heap<!fir.array<?x!fir.type<_QMpolyTp1{a:i32,b:i32}>>>>>) -> !fir.ref<!fir.box<none>>
@@ -300,7 +300,7 @@ subroutine test_allocatable()
300
300
! CHECK: %[[TYPE_DESC_P2_CAST:.*]] = fir.convert %[[TYPE_DESC_P2]] : (!fir.tdesc<!fir.type<_QMpolyTp2{a:i32,b:i32,c:i32}>>) -> !fir.ref<none>
301
301
! CHECK: %[[RANK:.*]] = arith.constant 1 : i32
302
302
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
303
- ! CHECK: fir.call @_FortranAAllocatableInitDerived (%[[C4_CAST]], %[[TYPE_DESC_P2_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
303
+ ! CHECK: fir.call @_FortranAAllocatableInitDerivedForAllocate (%[[C4_CAST]], %[[TYPE_DESC_P2_CAST]], %[[RANK]], %[[C0]]) {{.*}}: (!fir.ref<!fir.box<none>>, !fir.ref<none>, i32, i32) -> none
304
304
! CHECK: %[[CST1:.*]] = arith.constant 1 : index
305
305
! CHECK: %[[C20:.*]] = arith.constant 20 : i32
306
306
! CHECK: %[[C0:.*]] = arith.constant 0 : i32
@@ -381,7 +381,7 @@ subroutine test_unlimited_polymorphic_with_intrinsic_type_spec()
381
381
! CHECK: %[[KIND:.*]] = arith.constant 4 : i32
382
382
! CHECK: %[[RANK:.*]] = arith.constant 0 : i32
383
383
! CHECK: %[[CORANK:.*]] = arith.constant 0 : i32
384
- ! CHECK: %{{.*}} = fir.call @_FortranAAllocatableInitIntrinsic (%[[BOX_NONE]], %[[CAT]], %[[KIND]], %[[RANK]], %[[CORANK]]) {{.*}} : (!fir.ref<!fir.box<none>>, i32, i32, i32, i32) -> none
384
+ ! CHECK: %{{.*}} = fir.call @_FortranAAllocatableInitIntrinsicForAllocate (%[[BOX_NONE]], %[[CAT]], %[[KIND]], %[[RANK]], %[[CORANK]]) {{.*}} : (!fir.ref<!fir.box<none>>, i32, i32, i32, i32) -> none
385
385
! CHECK: %[[BOX_NONE:.*]] = fir.convert %[[P]] : (!fir.ref<!fir.class<!fir.heap<none>>>) -> !fir.ref<!fir.box<none>>
386
386
! CHECK: %{{.*}} = fir.call @_FortranAAllocatableAllocate(%[[BOX_NONE]], %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {{.*}} : (!fir.ref<!fir.box<none>>, i1, !fir.box<none>, !fir.ref<i8>, i32) -> i32
387
387
@@ -548,7 +548,7 @@ subroutine test_allocatable_up_character()
548
548
! CHECK: %[[KIND:.*]] = arith.constant 1 : i32
549
549
! CHECK: %[[RANK:.*]] = arith.constant 0 : i32
550
550
! CHECK: %[[CORANK:.*]] = arith.constant 0 : i32
551
- ! CHECK: %{{.*}} = fir.call @_FortranAAllocatableInitCharacter (%[[A_NONE]], %[[LEN]], %[[KIND]], %[[RANK]], %[[CORANK]]) {{.*}} : (!fir.ref<!fir.box<none>>, i64, i32, i32, i32) -> none
551
+ ! CHECK: %{{.*}} = fir.call @_FortranAAllocatableInitCharacterForAllocate (%[[A_NONE]], %[[LEN]], %[[KIND]], %[[RANK]], %[[CORANK]]) {{.*}} : (!fir.ref<!fir.box<none>>, i64, i32, i32, i32) -> none
552
552
! CHECK: %[[A_NONE:.*]] = fir.convert %[[A:.*]] : (!fir.ref<!fir.class<!fir.heap<none>>>) -> !fir.ref<!fir.box<none>>
553
553
! CHECK: %{{.*}} = fir.call @_FortranAAllocatableAllocate(%[[A_NONE]], %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {{.*}} : (!fir.ref<!fir.box<none>>, i1, !fir.box<none>, !fir.ref<i8>, i32) -> i32
554
554
@@ -568,16 +568,16 @@ program test_alloc
568
568
569
569
! LLVM-LABEL: define void @_QMpolyPtest_allocatable()
570
570
571
- ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerived (ptr %{{.*}}, ptr @_QMpolyE.dt.p1, i32 0, i32 0)
571
+ ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerivedForAllocate (ptr %{{.*}}, ptr @_QMpolyE.dt.p1, i32 0, i32 0)
572
572
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableAllocate(ptr %{{.*}}, i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
573
- ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerived (ptr %{{.*}}, ptr @_QMpolyE.dt.p1, i32 0, i32 0)
573
+ ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerivedForAllocate (ptr %{{.*}}, ptr @_QMpolyE.dt.p1, i32 0, i32 0)
574
574
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableAllocate(ptr %{{.*}}, i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
575
- ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerived (ptr %{{.*}}, ptr @_QMpolyE.dt.p2, i32 0, i32 0)
575
+ ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerivedForAllocate (ptr %{{.*}}, ptr @_QMpolyE.dt.p2, i32 0, i32 0)
576
576
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableAllocate(ptr %{{.*}}, i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
577
- ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerived (ptr %{{.*}}, ptr @_QMpolyE.dt.p1, i32 1, i32 0)
577
+ ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerivedForAllocate (ptr %{{.*}}, ptr @_QMpolyE.dt.p1, i32 1, i32 0)
578
578
! LLVM: %{{.*}} = call {} @_FortranAAllocatableSetBounds(ptr %{{.*}}, i32 0, i64 1, i64 10)
579
579
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableAllocate(ptr %{{.*}}, i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
580
- ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerived (ptr %{{.*}}, ptr @_QMpolyE.dt.p2, i32 1, i32 0)
580
+ ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerivedForAllocate (ptr %{{.*}}, ptr @_QMpolyE.dt.p2, i32 1, i32 0)
581
581
! LLVM: %{{.*}} = call {} @_FortranAAllocatableSetBounds(ptr %{{.*}}, i32 0, i64 1, i64 20)
582
582
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableAllocate(ptr %{{.*}}, i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
583
583
! LLVM-COUNT-2: call void %{{.*}}()
@@ -661,6 +661,6 @@ program test_alloc
661
661
! LLVM: store { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] } { ptr null, i64 ptrtoint (ptr getelementptr (%_QMpolyTp1, ptr null, i32 1) to i64), i32 20180515, i8 0, i8 42, i8 2, i8 1, ptr @_QMpolyE.dt.p1, [1 x i64] undef }, ptr %[[ALLOCA1]]
662
662
! LLVM: %[[LOAD:.*]] = load { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }, ptr %[[ALLOCA1]]
663
663
! LLVM: store { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] } %[[LOAD]], ptr %[[ALLOCA2]]
664
- ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerived (ptr %[[ALLOCA2]], ptr @_QMpolyE.dt.p1, i32 0, i32 0)
664
+ ! LLVM: %{{.*}} = call {} @_FortranAAllocatableInitDerivedForAllocate (ptr %[[ALLOCA2]], ptr @_QMpolyE.dt.p1, i32 0, i32 0)
665
665
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableAllocate(ptr %[[ALLOCA2]], i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
666
666
! LLVM: %{{.*}} = call i32 @_FortranAAllocatableDeallocatePolymorphic(ptr %[[ALLOCA2]], ptr {{.*}}, i1 false, ptr null, ptr @_QQcl.{{.*}}, i32 {{.*}})
0 commit comments