progs/fun2/sqr.ll
changeset 826 b0352633bf48
parent 820 7fd1f611c21d
child 854 ce4a7bab6bd8
equal deleted inserted replaced
825:dca072e2bb7d 826:b0352633bf48
    34    call i32 (i8*, ...) @printf(i8* %t0, i32 %x) 
    34    call i32 (i8*, ...) @printf(i8* %t0, i32 %x) 
    35    ret void
    35    ret void
    36 }
    36 }
    37 
    37 
    38 ; END OF BUILD-IN FUNCTIONS (prelude)
    38 ; END OF BUILD-IN FUNCTIONS (prelude)
       
    39 
    39 @Max = global i32 10
    40 @Max = global i32 10
    40 
    41 
    41 define i32 @sqr (i32 %x) {
    42 define i32 @sqr (i32 %x) {
    42    %tmp_20 = mul i32  %x, %x
    43    %tmp_20 = mul i32  %x, %x
    43    ret i32 %tmp_20
    44    ret i32 %tmp_20