Code: Alles auswählen
program test1;
function test(p1: int32): int32;
var
i1: int32;
begin
i1:= p1;
result:= p1+i1;
end;
begin
exitcode:= test(123);
end.
Code: Alles auswählen
.file "test-opt.ll"
.text
.globl main
.align 16, 0x90
.type main,@function
main: # @main
# BB#0:
movl $246, %eax
ret
.Ltmp0:
.size main, .Ltmp0-main
.section ".note.GNU-stack","",@progbits
Code: Alles auswählen
.file "test1.pas"
[...]
.globl P$TEST1_TEST$LONGINT$$LONGINT
.type P$TEST1_TEST$LONGINT$$LONGINT,@function
P$TEST1_TEST$LONGINT$$LONGINT:
# Temps allocated between esp+0 and esp+0
# Var p1 located in register edx
# Var $result located in register eax
# Var i1 located in register eax
# [test1.pas]
# [6] begin
movl %eax,%edx
# [7] i1:= p1;
movl %edx,%eax
# [8] result:= p1+i1;
addl %edx,%eax
# [9] end;
ret
[...]
.globl main
.type main,@function
main:
# Temps allocated between esp+0 and esp+0
# [11] begin
call FPC_INITIALIZEUNITS
# [12] exitcode:= test(123);
movl $123,%eax
call P$TEST1_TEST$LONGINT$$LONGINT
movl %eax,operatingsystem_result
# [13] end.
call FPC_DO_EXIT
ret
[...]