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
|
; ModuleID = 'LFortran'
source_filename = "LFortran"
%string_descriptor = type <{ i8*, i64 }>
@string_const_data = private constant [18 x i8] c"echo \22Hello World\22"
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([18 x i8], [18 x i8]* @string_const_data, i32 0, i32 0), i64 18 }>
@string_const_data.1 = private constant [2 x i8] c"ls"
@string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.1, i32 0, i32 0), i64 2 }>
define void @_lcompilers_execute_command_line_(%string_descriptor* %command, i1* %wait) {
.entry:
%_lcompilers_exit_status = alloca i32, align 4
%0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
%1 = load i8*, i8** %0, align 8
%2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
%3 = load i8*, i8** %2, align 8
%4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1
%5 = load i64, i64* %4, align 4
%6 = trunc i64 %5 to i32
%7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6)
store i32 %7, i32* %_lcompilers_exit_status, align 4
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE__lcompilers_execute_command_line_
FINALIZE_SYMTABLE__lcompilers_execute_command_line_: ; preds = %return
ret void
}
declare i32 @_lfortran_exec_command(i8*, i32)
define void @_lcompilers_execute_command_line_1(%string_descriptor* %command, i1* %wait) {
.entry:
%_lcompilers_exit_status = alloca i32, align 4
%0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
%1 = load i8*, i8** %0, align 8
%2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
%3 = load i8*, i8** %2, align 8
%4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1
%5 = load i64, i64* %4, align 4
%6 = trunc i64 %5 to i32
%7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6)
store i32 %7, i32* %_lcompilers_exit_status, align 4
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE__lcompilers_execute_command_line_1
FINALIZE_SYMTABLE__lcompilers_execute_command_line_1: ; preds = %return
ret void
}
define i32 @main(i32 %0, i8** %1) {
.entry:
%call_arg_value1 = alloca i1, align 1
%call_arg_value = alloca i1, align 1
call void @_lpython_call_initial_functions(i32 %0, i8** %1)
store i1 true, i1* %call_arg_value, align 1
call void @_lcompilers_execute_command_line_(%string_descriptor* @string_const, i1* %call_arg_value)
store i1 true, i1* %call_arg_value1, align 1
call void @_lcompilers_execute_command_line_1(%string_descriptor* @string_const.2, i1* %call_arg_value1)
call void @_lpython_free_argv()
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_execute_command_line
FINALIZE_SYMTABLE_execute_command_line: ; preds = %return
ret i32 0
}
declare void @_lpython_call_initial_functions(i32, i8**)
declare void @_lpython_free_argv()
|