1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
; ModuleID = 'LFortran'
source_filename = "LFortran"
%string_descriptor = type <{ i8*, i64 }>
@0 = private unnamed_addr constant [2 x i8] c"w\00", align 1
@1 = private unnamed_addr constant [191 x i8] c"At 5:8 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1
@2 = private unnamed_addr constant [2 x i8] c"w\00", align 1
@3 = private unnamed_addr constant [192 x i8] c"At 18:1 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1
@4 = private unnamed_addr constant [2 x i8] c"a\00", align 1
@5 = private unnamed_addr constant [215 x i8] c"At 19:8 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array shape mismatch in subroutine '%s'\0A\0ATried to match size %d of dimension %d of argument number %d, but expected size is %d\0A\00", align 1
@6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [5 x i8] c"[R8]\00", align 1
@7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@8 = private unnamed_addr constant [2 x i8] c"w\00", align 1
@9 = private unnamed_addr constant [192 x i8] c"At 21:9 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1
@"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@12 = private unnamed_addr constant [2 x i8] c"w\00", align 1
@13 = private unnamed_addr constant [192 x i8] c"At 22:9 of file tests/../integration_tests/legacy_array_sections_01.f90\0ARuntime error: Array '%s' index out of bounds.\0A\0ATried to access index %d of dimension %d, but valid range is %d to %d.\0A\00", align 1
@14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
define void @a(double* %w) {
.entry:
%icon = alloca i32, align 4
store i32 2, i32* %icon, align 4
%0 = load i32, i32* %icon, align 4
%1 = sub i32 %0, 1
%2 = mul i32 1, %1
%3 = add i32 0, %2
%4 = icmp slt i32 %0, 1
%5 = icmp sgt i32 %0, 5
%6 = or i1 %4, %5
br i1 %6, label %then, label %ifcont
then: ; preds = %.entry
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 %0, i32 1, i32 1, i32 5)
call void @exit(i32 1)
unreachable
ifcont: ; preds = %.entry
%7 = getelementptr inbounds double, double* %w, i32 %3
call void @b(double* %7)
br label %return
unreachable_after_return: ; No predecessors!
br label %return
return: ; preds = %unreachable_after_return, %ifcont
br label %FINALIZE_SYMTABLE_a
FINALIZE_SYMTABLE_a: ; preds = %return
ret void
}
define void @b(double* %con) {
.entry:
%0 = getelementptr inbounds double, double* %con, i32 3
store double -4.830000e+00, double* %0, align 8
%1 = getelementptr inbounds double, double* %con, i32 2
store double 3.140000e+00, double* %1, align 8
br label %return
unreachable_after_return: ; No predecessors!
br label %return
return: ; preds = %unreachable_after_return, %.entry
br label %FINALIZE_SYMTABLE_b
FINALIZE_SYMTABLE_b: ; preds = %return
ret void
}
declare void @_lcompilers_print_error(i8*, ...)
declare void @exit(i32)
define i32 @main(i32 %0, i8** %1) {
.entry:
%array_bound2 = alloca i32, align 4
%array_bound = alloca i32, align 4
%__libasr_index_0_ = alloca i32, align 4
call void @_lpython_call_initial_functions(i32 %0, i8** %1)
%__libasr_index_0_1 = alloca i32, align 4
%w = alloca [5 x double], align 8
br i1 true, label %then, label %else
then: ; preds = %.entry
store i32 1, i32* %array_bound, align 4
br label %ifcont
else: ; preds = %.entry
br label %ifcont
ifcont: ; preds = %else, %then
%2 = load i32, i32* %array_bound, align 4
%3 = sub i32 %2, 1
store i32 %3, i32* %__libasr_index_0_1, align 4
br label %loop.head
loop.head: ; preds = %ifcont7, %ifcont
%4 = load i32, i32* %__libasr_index_0_1, align 4
%5 = add i32 %4, 1
br i1 true, label %then3, label %else4
then3: ; preds = %loop.head
store i32 5, i32* %array_bound2, align 4
br label %ifcont5
else4: ; preds = %loop.head
br label %ifcont5
ifcont5: ; preds = %else4, %then3
%6 = load i32, i32* %array_bound2, align 4
%7 = icmp sle i32 %5, %6
br i1 %7, label %loop.body, label %loop.end
loop.body: ; preds = %ifcont5
%8 = load i32, i32* %__libasr_index_0_1, align 4
%9 = add i32 %8, 1
store i32 %9, i32* %__libasr_index_0_1, align 4
%10 = load i32, i32* %__libasr_index_0_1, align 4
%11 = sub i32 %10, 1
%12 = mul i32 1, %11
%13 = add i32 0, %12
%14 = icmp slt i32 %10, 1
%15 = icmp sgt i32 %10, 5
%16 = or i1 %14, %15
br i1 %16, label %then6, label %ifcont7
then6: ; preds = %loop.body
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 %10, i32 1, i32 1, i32 5)
call void @exit(i32 1)
unreachable
ifcont7: ; preds = %loop.body
%17 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 %13
store double 1.390000e+00, double* %17, align 8
br label %loop.head
loop.end: ; preds = %ifcont5
br i1 false, label %then8, label %ifcont9
then8: ; preds = %loop.end
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([215 x i8], [215 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 5, i32 1, i32 1, i32 5)
call void @exit(i32 1)
unreachable
ifcont9: ; preds = %loop.end
%18 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 0
call void @a(double* %18)
%19 = alloca i64, align 8
%20 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 0
%21 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @serialization_info, i32 0, i32 0), i64* %19, i32 1, i32 0, i64 5, double* %20)
%22 = load i64, i64* %19, align 4
%stringFormat_desc = alloca %string_descriptor, align 8
%23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
store i8* %21, i8** %23, align 8
%24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
store i64 %22, i64* %24, align 4
%25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
%26 = load i8*, i8** %25, align 8
%27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
%28 = load i64, i64* %27, align 4
%29 = trunc i64 %28 to i32
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %26, i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1)
call void @_lfortran_free(i8* %21)
br i1 false, label %then10, label %ifcont11
then10: ; preds = %ifcont9
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0), i32 5, i32 1, i32 1, i32 5)
call void @exit(i32 1)
unreachable
ifcont11: ; preds = %ifcont9
%30 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 4
%31 = load double, double* %30, align 8
%32 = fsub double %31, -4.830000e+00
%33 = call double @llvm.fabs.f64(double %32)
%34 = fcmp ogt double %33, 1.000000e-08
br i1 %34, label %then12, label %else13
then12: ; preds = %ifcont11
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0))
call void @exit(i32 1)
br label %ifcont14
else13: ; preds = %ifcont11
br label %ifcont14
ifcont14: ; preds = %else13, %then12
br i1 false, label %then15, label %ifcont16
then15: ; preds = %ifcont14
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 4, i32 1, i32 1, i32 5)
call void @exit(i32 1)
unreachable
ifcont16: ; preds = %ifcont14
%35 = getelementptr [5 x double], [5 x double]* %w, i32 0, i32 3
%36 = load double, double* %35, align 8
%37 = fsub double %36, 3.140000e+00
%38 = call double @llvm.fabs.f64(double %37)
%39 = fcmp ogt double %38, 1.000000e-10
br i1 %39, label %then17, label %else18
then17: ; preds = %ifcont16
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0))
call void @exit(i32 1)
br label %ifcont19
else18: ; preds = %ifcont16
br label %ifcont19
ifcont19: ; preds = %else18, %then17
call void @_lpython_free_argv()
br label %return
return: ; preds = %ifcont19
br label %FINALIZE_SYMTABLE_legacy_array_sections_01
FINALIZE_SYMTABLE_legacy_array_sections_01: ; preds = %return
ret i32 0
}
declare void @_lpython_call_initial_functions(i32, i8**)
declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...)
declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)
declare void @_lfortran_free(i8*)
; Function Attrs: nounwind readnone speculatable willreturn
declare double @llvm.fabs.f64(double) #0
declare void @_lpython_free_argv()
attributes #0 = { nounwind readnone speculatable willreturn }
|