1 ! RUN: bbc %s -o - | tco | FileCheck %s
2 ! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s
3 ! Test from Fortran source through to LLVM IR.
4 ! UNSUPPORTED: system-windows
6 ! Assumed size array of assumed length character.
8 character :: x(3) = (/ '1','2','3' /)
14 x(i
:i
)(1:1) = x(i
+1:i
+1)(1:1)
20 ! CHECK-LABEL: define void @_QFPsub(
21 ! CHECK-SAME: ptr %[[arg:.*]])
22 ! CHECK: %[[extent:.*]] = getelementptr { {{.*}}, [1 x [3 x i64]] }, ptr %[[arg]], i32 0, i32 7, i64 0, i32 1
23 ! CHECK: %[[extval:.*]] = load i64, ptr %[[extent]]
24 ! CHECK: %[[elesize:.*]] = getelementptr { {{.*}}, [1 x [3 x i64]] }, ptr %[[arg]], i32 0, i32 1
25 ! CHECK: %[[esval:.*]] = load i64, ptr %[[elesize]]
26 ! CHECK: %[[mul:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[esval]]
27 ! CHECK: %[[mul2:.*]] = mul i64 %[[mul]], %[[extval]]
28 ! CHECK: %[[buff:.*]] = call ptr @malloc(i64 %[[mul2]])
29 ! CHECK: %[[to:.*]] = getelementptr i8, ptr %[[buff]], i64 %
30 ! CHECK: call void @llvm.memmove.p0.p0.i64(ptr %[[to]], ptr %{{.*}}, i64 %{{.*}}, i1 false)
31 ! CHECK: call void @free(ptr %[[buff]])
32 ! CHECK: call ptr @_FortranAioBeginExternalListOutput