Codefox icon

Untitled

Codefox | PRO | 12/08/14 12:52:58 PM UTC | 0 ⭐ | 15240 👁️ | Never ⏰ | []
LLVM |

580 B

|

None

|

0 👍

/

0 👎

; String-Konstante als globale Konstante deklarieren
@.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
 
; Externe Deklaration der `puts()`-Funktion (enthalten in libc)
declare i32 @puts(i8* nocapture) nounwind
 
; Definition der `main()`-Funktion
define i32 @main() {   ; i32()*
  ; Konvertiere [13 x i8]* zu i8  *... (Pointer auf i8-Elemente)
  %cast210 = getelementptr [13 x i8]* @.str, i64 0, i64 0
 
  ; Rufe `puts()`-Funktion auf, um Text auszugeben
  call i32 @puts(i8* %cast210)
  ret i32 0
}
 
; Metadaten
!1 = metadata !{i32 42}
!foo = !{!1, null}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎