Advertisement
Codefox

Untitled

Dec 8th, 2014
2,722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 0.58 KB | None | 0 0
  1. ; String-Konstante als globale Konstante deklarieren
  2. @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
  3.  
  4. ; Externe Deklaration der `puts()`-Funktion (enthalten in libc)
  5. declare i32 @puts(i8* nocapture) nounwind
  6.  
  7. ; Definition der `main()`-Funktion
  8. define i32 @main() {   ; i32()*
  9.   ; Konvertiere [13 x i8]* zu i8  *... (Pointer auf i8-Elemente)
  10.   %cast210 = getelementptr [13 x i8]* @.str, i64 0, i64 0
  11.  
  12.   ; Rufe `puts()`-Funktion auf, um Text auszugeben
  13.   call i32 @puts(i8* %cast210)
  14.   ret i32 0
  15. }
  16.  
  17. ; Metadaten
  18. !1 = metadata !{i32 42}
  19. !foo = !{!1, null}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement